Duplicator-related issues
A bug in 2.2, submitted by eKoeS on 29 December 2010
Announcement
Symphony's issue tracker has been moved to Github.
Issues are displayed here for reference only and cannot be created or edited.
Browse
Closed#451: Duplicator-related issues
It seems like the duplicator plugin isn’t chainable at the moment.
As you can see in the image, the styles for i elements are gone.
Fixed. Will post a commit tomorrow.
class.field.php
, line 828
:
$wrapper->appendChild(new XMLElement('h4', $this->get('label') . ' <i>'.$this->Name().'</i>'));
$this->handle()
(2.2) is used instead of $this->Name()
(2.1.2), causing the filters duplicator to look like this:
Is there a reason why something like “selectbox_link” is preferred to “Select Box Link” which is more human readable (if it’s not just a mistake, of course) ?
Does $this->Name()
still exist in 2.2? If so, I guess this is a mistake.
Does $this->Name() still exist in 2.2?
Yes, it does. ;)
Simone, I haven’t found the reason why the duplicator plugin doesn’t chain correctly but this should solve the event issue:
// Collapsible duplicators var duplicator = $('#fields-duplicator'); duplicator.symphonyDuplicator({ orderable: true, collapsible: true }); duplicator.bind('collapsestop', function(event, item) { var instance = jQuery(item); instance.find('.header > span:not(:has(i))').append( $('<i />').text(instance.find('label:first input').attr('value')) ); }); duplicator.bind('expandstop', function(event, item) { $(item).find('.header > span > i').remove(); });
Ah, and by the way, I just updated my integration branch and it displays the name and not the handles in the field duplicators. Haven’t checked the source yet.
Okay, after further investigations I found the cause of the chaining issues: it’s the usage of objects.map()
instead of objects.each()
in the core plugins which wraps the elements in another object and thus breaks the chain. As the current implementation relies on .map()
the code posted above will be the simplest solution for Symphony 2.2. We should rethink the whole implementation for Symphony 3.
Simone, will you bundle this fix in your pull request or should I prepare a separate one?
Don’t worry Nils, I can include your fix in my pull request. Thanks for taking the time to investigate that bug! :)
As far as #3 is concerned, I’ve looked at the most recent class.field.php
file and it uses $this->handle()
(https://github.com/symphonycms/symphony-2/blob/integration/symphony/lib/toolkit/class.field.php#L828). I’m pretty sure I’ve got the latest changes on my localhost, but I’ll do a fetch & merge as soon as I can to verify that.
No luck so far. I still see the handle.
Ah, sorry, I was in the section editor. You’re right about the handle in the data source editor.
This issue is closed.
i
elements are gone.