Code Monkey home page Code Monkey logo

subsectionmanager's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

subsectionmanager's Issues

New items not correctly added

  1. Open the section with subsection manager field.
  2. Open the section linked as subsection in the normal Symphony interface.
  3. Create a new entry.
  4. Return to the first section, click browse and add this new entry.
  5. Click save and the item will disappear in the selection.

Reason: While the queue is updated automatically the underlying select box is not.

Cannot use a scalar value as an array

I'm getting the following error under Symphony 2.0.8 when saving the parent entry (the subsection seems to save fine and is composed of a single Unique Upload Field).

Cannot use a scalar value as an array
/Users/tonyarnold/Sites/tonyarnold.local/extensions/subsectionmanager/fields/field.subsectionmanager.php line 444

439      * @param string $mode
440      */
441     public function appendFormattedElement(&$wrapper, $data, $encode = false) {
442
443         // unify data
444         if(!is_array($data['relation_id'])) $data['relation_id'] = array($data['relation_id']);
445
446         // create Subsection Manager element
447         $subsectionmanager = new XMLElement($this->get('element_name'));
448

Every Publish Page opened in an iframe gets Subsectionmanager JS

I'm loading Publish Pages into an iframe in a separate extension and the JavaScript from symphony.subsection.js gets fired and breaks/modifies the original layout. The logic to either load the Subsectionmanager assets or to call the JS modifications should be stricter.

New entries not attached upon save

I have a feeling this is in some way related to http://github.com/nilshoerrmann/subsectionmanager/issues#issue/30

It would appear that a new entry created in a Subsection Manager field, of a section with no entries, the entry does not stay attached to the entry when saved. (guh, what a mouthful)

To reproduce:

  1. Create a basic setup of one section with a subsection field pointing to another section. For this example I will just Articles and Categories.
  2. Create an Article, adding a new category entry via the subsection manager field
  3. Save the article

Expected: The new category has been created and is attached to the article
Actual Result: The new category entry is created, but not attached to the article

Some things I have observed.

  1. This appears to only happen when there are no entries in the, for example, "category" section. If I manually create a category first, and follow the same steps above, the bug is not reproduced.
  2. The POST data when saving when there are no existing categories, and the POST data after saving when there are existing categories differs.

Here is the POST data when there are no existing categories:

array
  'MAX_FILE_SIZE' => string '5242880' (length=7)
  'fields' => 
    array
      'title' => string 'Banana' (length=12)
      'sort_order' => 
        array
          163 => string '18,0' (length=4)
      'subsection_id' => 
        array
          163 => string '34' (length=2)
  'action' => 
    array
      'save' => string 'Create Entry' (length=12)

and here is the POST data when there are existing categories (not this is not attaching an existing. A new category is still created in the Subsection Manager field as in the first example):

array
  'MAX_FILE_SIZE' => string '5242880' (length=7)
  'fields' => 
    array
      'title' => string 'Banana' (length=12)
      'categories' => 
        array
          0 => string '18' (length=2)
      'sort_order' => 
        array
          163 => string '' (length=0)
      'subsection_id' => 
        array
          163 => string '34' (length=2)
  'action' => 
    array
      'save' => string 'Create Entry' (length=12)

Notice the missing 'categories' item in the POST data of the first example.

I am hopeful that helps debug the problem.

Updating to RC1

Couple of problems when updating.

It seems there is a new table, tbl_fields_stage, which is created on install, but not update. Throws errors if you try to access a sections publish area with an existing subsection field.

Secondly, there is no submodule mapping for lib/stage anymore, and this seems to stuff up the repo. I added it to my fork, and that seemed to fix the problem.

Used as Output Parameter shows only first result

When Output Parameter in Data Source is set to Subsecton Manager only first result is used even if there is more.

Removing line: if(is_array($data['relation_id'])) return implode(",", $data['relation_id']); in function getParameterPoolValue in field.subsectionmanager.php seems to be a solution.

Strange queue order

I just discovered that the queue actually shows the same strange order as my items after saving them for the first time (see issue #17). I can't really tell how the items are ordered in the queue though, as I have a text input with dates as my first field and the first three items show up in the queue like this:

18.12.2006
15.01.2007
05.02.2007

Error on initial page load

If you load an entry edit page containing a Subsection Manager field, you will see the following error in the firebug console:

"NetworkError: 404 Not Found - http://me/symphony207/symphony/publish/images/%7b$action%7d/%7b$id%7d/"

Even without really understanding the manager class, I am rather sure this error is connected to the create_new variable, which is defined in line 378 of field.subsectionmanager.php:

$create_new = URL . '/symphony/publish/' . $subsection_handle . '/{$action}/{$id}';

The {$action}/{$id} pattern is perfidious, isn't it?

Unable to select a just created item

Here are the steps to reproduce it:

  1. Create an entry and save it
  2. Click on “Browse”
  3. De-select it by clicking on the (x) button
  4. Click on “Browse”
  5. Try to select the newly created item

You won't be able to select that item as you would expect to. As far as I know, it only happens when you follow the above procedure.

Firebug warnings when using search

Typing something into the search field, you will find warnings in the firebug console:

Die 'charCode'-Eigenschaft eines keyup-Ereignisses sollte nicht verwendet werden. Der Wert ist bedeutungslos.

(German version of firebug...)

There is one warning for each character you type.

New Items Not Added Properly

When I add an item from an upload, Subsection Manager doesn't save that and add it to the selection. Instead, once I have added the item for upload, I have to save the Subsection Manager part, then save the actual page I am editing. Then I need go back into the Subsection Manager, add the newly uploaded file to the selection, then re-save the main page.

This is using a fresh install of Symphony 2.1 and the latest Subsection Manager, Stage and Draggable.

File paths don't honor Symphony being installed in a subdirectory

If you have installed Symphony in a subdirectory (.i.e. not in the root of your website), none of the file paths will work - not even the one which is displayed in "edit mode". Those links are root links, so they must include the subdirectory (resp. the full URL).

"Create new" button is active while creating a new entry

I've not verified this myself, but this report is from a colleague.

When uploading large files over a slow connection this is more noticable. Click "Create new" to open the form. Click "Create new" again and it opens another form. Upload a file in the first, and both disappear once complete. My colleague was trying to upload multiple (large) images simultaneously with odd results.

I think the Create New button should only be active once. If the create form is open, it shouldn't be clickable.

Unencoded ampersands results in invalid backend HTML

When writing out the hidden <select>, values for each option are not sanitised. This results in invalid HTML markup, and will break extensions such as Publish Filtering and Section Schemas which attempt to parse this markup using XPath.

The solution seems to be in class.subsectionmanager.php, line 170:

$options[] = ... General::sanitize($field_value));

Deselecting an expanded entry doesn't hide its details

Here are the steps to reproduce it:

  1. Click on an entry in order to edit it
  2. Deselect the entry by clicking on the (x) button

The caption is removed, but the dark box with all the details stays in place, thus allowing you to keep editing the entry.

Experienced on: Chromium 5.0.375.125, Firefox 3.6.8.

Subsection Manager not working on Opera 10.61

While using Opera 10.61, I noticed that the Subsection Managet interface is broken. In fact, the white bar (with the search input and the "Create new" button) is not displayed at all.

Opera is the only one with this kind of rendering issue. All other browsers (except IE which hasn't been tested) behaves as expected.

Editing handle

Clicking outside the caption to edit an item will open and immediately close the drawer.

Datasource output breaks if textarea is included

If you include a textarea (which uses a text formatter) in the datasource output, page rendering will break with the following error:

Missing argument 4 for fieldTextarea::appendFormattedElement(), called in /Users/me/Sites/dev/me/symphony207/extensions/subsectionmanager/fields/field.subsectionmanager.php on line 509 and defined
/Users/me/Sites/dev/me/symphony207/symphony/lib/toolkit/fields/field.textarea.php line 166

161     
162     private function __replaceAmpersands($value) {
163         return preg_replace('/&(?!(#[0-9]+|#x[0-9a-f]+|amp|lt|gt);)/i', '&', trim($value));
164     }
165     
166     public function appendFormattedElement(&$wrapper, $data, $encode = false, $mode) {
167         
168         if ($mode == null || $mode == 'formatted') {
169             
170             if ($this->get('formatter') && isset($data['value_formatted'])) {

The problem seems to be that in line 509 of field.subsectionmanager.php the $mode argument is missing. So if you replace this line for example by

$field->appendFormattedElement($item, $values, false, NULL);

it works - but I am completely unsure about the correct $mode value!!!

To Do

  • The uninstall function has to care about tbl_fields_stage as well. Done.
  • Finish the Mediathek upgrader.
  • Finish German translation.
  • Automatically check existence of all submodules.

Missing preferences

It should be possible to set the options for dragging, sorting, searching and creating of items in the preferences directly.

Table 'something.sym_fields_stage' doesn't exist in RC2

Following error appers in clean instalation of Symphony 2.1 + Subsection Manager 1.0RC2 when creating new section:

Symphony Fatal Database Error
Table 'test.sym_fields_stage' doesn't exist

An error occurred while attempting to execute the following query

  • SELECT * FROM sym_fields_stage WHERE field_id = '' LIMIT 1

Newly created item stuck in queue

I created a new item while my queue was visible ("browse"). It was added to the bottom of the queue but was not added to my selection. It showed a delete button on the right hand side which didn't work though, and it couldn't be selected to add it to my selection either. I had to delete it in my original section to get rid of it.

Screenshot of what it looked like

Usability: focus first form element

This morning I created about 30 entries through Subsection Manager, by copy/pasting text from an email. A little UX tweak that would go a long way would be to give the first input in the sub-section focus when creating a new entry, saving an extra click. The panel slides open, and is primed for data entry.

Eternal spinning wheel if no search results are found

If search does not return any items, there will be a slow-moving "spinning wheel". This normally indicates that the engine is working hard (which is worth the wait). In fact waiting won't help. So it would be better to simply display nothing or - alternatively - a text like "nothing found".

Drag and drop file paths are wrong

The "drag and drop file paths" as well as the displayed file paths (using the {$file} parameter in the subsection manager field setting) are missing the "workspace" part. So Markdown links won't work at all.

This can be seen in the Forum discussion as well.

File Upload CSS

Seems to be a weird issue in which the file fields color is set to white, which makes it impossible to see if a file has been selected by the extension.

body.subsection form input[type="file"] {
    color: #fff;
}

Removing the above declaration fixes the problem.

FF 3.6.3 on MacOSX

Creating an item won't work immediately after deleting an item

Steps to reproduce (tested in latest Safari and Firefox on mac OS X):

  • delete an item
  • do not save your entry
  • click on "create new"
  • the GUI is broken

You will see the text "New item - Please fill out the form below", but there is no form below nor elsewhere.

The accordion doesn't work properly

Under some unknown circumstances, clicking on a selected entry won't make it expanded. It seems to happen half of the times.

Experienced on: Chromium 5.0.375.125, Firefox 3.6.8. Not able to reproduce that.

Mouseup event re-opens "Edit" panel

Steps to reproduce:

  • click on an item to expand the "edit" panel
  • click on the item again to collapse, but this time keep your mouse pressed until the panel closes
  • let go once the panel has collapsed, and mouseup will open the panel again

Order of newly created items isn't saved

I started with a "blank" manager and added one item after another and they were automatically added to the bottom to the list. However, when saving the whole entry, the item order was messed up so that I had to reorder my items manually. This time, the order was saved just fine when saving the entry,

Opening an existing item doesn't close the stage of "Create new"

I click "Create new", the stage opens, I click an existing item above it, this item's stage opens but the "Create new" remains open as well. Clicking the either the new or existing item's draggable top closes both stages and both items remain in the list. Clicking the new item opens the stage (without any fields) and closes it almost completely again right away. I can delete this new item without any problems though.

(I'm sending you some snaps via mail)

Conflict with CacheLite

Nils—

I've started looking into what's causing the conflict between CacheLite and the Subsection Manager, and I've narrowed it down to line 63 of extension.driver.php:

$callback = Administration::instance()->getPageCallback();

Changing this to...

$callback = $this->_Parent->getPageCallback();

...fixes the conflict, though I'm not sure why the conflict exists in the first place. Note that the error only happens on the /system/preferences/ page and CacheLite isn't doing anything there apart from appending/saving preferences.

Thoughts?

It is not obvious that items are draggable

This was brought up on the forum. I would like to suggest that the default cursor is the "drag" cursor, making it plainly obvious that items can be re-orderable (which is a killer feature!). Perhaps there should be an "edit" button beside the "X" button?

To me, it is more probably that a user would want to re-order than edit, so the more frequent action should have precedence.

(But that's just me.)

[RC1] Cannot select multiple existing items

Seems that RC1 has introduced a bug where selecting a 2nd item removes the 1st. Could this be related to the new table "stage" and a lack of configuration data after upgrading?

Unique Upload Field text invisible inside of Subsection Manager

When using the Subsection Manager field with a Unique Upload Field, after selecting an image in the file browser the field remains visually empty but upon saving an image is uploaded.

No javascript errors are observable during this issue.

Latest versions of Draggable, Stage, Subsection Manager and the Unique Upload Field. Other fields in use are the Text Box field. Used on Symphony 2.0.8RC2.

If you'd like, send me a message and I can send you a login for the respective page.

Error when creating new section

Symphony Warning appears when saving new section with subsection manager included.

explode() expects parameter 2 to be string, array given
/Users/grzegorz/Sites/vimuseo.fi/www-2/extensions/subsectionmanager/fields/field.subsectionmanager.php line 227

222         foreach($field_groups as $group) {
223             if(!is_array($group['fields'])) continue;
224             $fields = array();
225             foreach($group['fields'] as $field){
226                 if($field->get('id') != $this->get('id')) {
227                     $fields[] = array($field->get('id'), (in_array($field->get('id'), explode(',', $this->get('included_fields')))), $field->get('label'));
228                 }
229             }
230             if(is_array($fields) && !empty($fields)) {
231                 $options[] = array('label' => $group['section']->get('id'), 'options' => $fields);

Incorrectly follows link to image asset

When adding an entry from a keyword search, click on that entry in the list (when it has an image) takes me to that image. This means I cannot drag and drop (upon dropping it loads the image).

To reproduce:

  • select an image from the available list by clicking on it
  • the image row is added to the selected list at the top
  • click on the row added to the selected list

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.