Tagged: compatibility acf
- This topic has 10 replies, 3 voices, and was last updated 6 years ago by
Steve.
-
AuthorPosts
-
-
July 12, 2015 at 9:20 pm #4004
ndmurph04MemberHi guys – We use Piklist fairly extensively for some of our core plugins, but some of the themes that our agency partners deliver utilize ACF, and there are a couple unique things it does well – particularly the flexible content plugin. In any case, even on pages where I do not have any Piklist metaboxes, when Piklist is active it breaks the drag ‘n drop functionality of ACF’s flexible content field.
Basically, every time you start dragging, dozens of drop zones get created. Disable Piklist and everything goes back to normal. I have not done in-depth debugging, but I would expect that the jQuery UI sortable selector that Piklist uses for some of its fields (like repeater) is too broad and also getting attached to the ACF fields. Would really like to get these two playing nicely together!
-
July 13, 2015 at 9:48 pm #4009
SteveKeymaster@ndmurph04– Welcome to the Piklist Community!
This is on our list of bugs to fix. We just haven’t got to it yet. If you’d like to help debug it would be appreciated.
-
July 27, 2015 at 8:48 pm #4086
ndmurph04MemberHey Steve –
I found the issue but I’m not sure where I need to commit a fix – is there a GitHub anywhere that I can fork? Basically, on line 18 of piklist.js, there are a couple events being attached to all elements with class meta-box-sortable. It appears that this handler conflicts with ACF (maybe it’s doing the same thing?) because when I comment it out, the issues go away. I believe the right way to handle it would be to look for $(‘.meta-box-sortable .piklist-meta-box’).closest(‘.meta-box-sortable’) – that would ensure that the patch is only applied to Piklist metaboxes and hoepfully prevent conflicts with other frameworks. Happy to make the code update if there’s somewhere I can commit to – cheers!
Rory
-
July 28, 2015 at 10:55 am #4090
SteveKeymaster@ndmurph04– I sent you an email with instructions and latest beta. Thanks for contributing to Piklist!
-
January 21, 2016 at 3:29 pm #5689
Gabe ShackleMemberHas there been any progress on this one? I’m using 0.9.9.7 and it’s doing the opposite for me. ACF flexible content fields drag and drop fine but the Piklist add_more items create the large amount of empty placeholders. It’s also throwing the following JS error:
“Uncaught TypeError: Cannot read property ‘onpageload’ of undefined”
-
January 21, 2016 at 4:07 pm #5690
Gabe ShackleMemberA little further investigation points to it being specifically related to any flexible content field layout that includes the WYSIWYG editor. Flexible content layouts that do not have any WYSIWYGs in them do not trigger the error.
-
January 21, 2016 at 10:36 pm #5695
Gabe ShackleMemberI’ve tracked it down to the admin.js file in Piklist. On lines 1052 and 1073 where you’re assigning the ‘sortstart’ and ‘sortstop sortreceive’ events, it’s not being specific enough and picks up the editors that are within ACF. A simple fix to make sure that those events are targeting the correct elements prevents the error from occurring and the sorting works as expected. I’ve attached my version of the admin.js file with this fix in place.
-
January 21, 2016 at 10:37 pm #5696
Gabe ShackleMemberLooks like ZIPs don’t work either so I’ve posted the updated admin.js here: http://hereswhatidid.com/media/admin.js.zip
-
January 22, 2016 at 4:08 pm #5697
SteveKeymaster@gabeshackle– This is awesome! Thank you so much for contributing.
Unfortunately, though this fixes add-more fields, it breaks another type of field. If you place an editor in a meta-box and try to drag-n-drop the meta-box, it won’t work.
-
January 22, 2016 at 4:18 pm #5698
Gabe ShackleMemberAh, I see that now. I hadn’t tried dragging the entire meta box. Here’s a quick fix that adds that condition in as well:
.on('sortstart', '.meta-box-sortables.ui-sortable, .piklist-field.ui-sortable', function(event, ui).on('sortstop sortreceive', '.meta-box-sortables.ui-sortable, .piklist-field.ui-sortable', function(event, ui) -
January 25, 2016 at 12:02 pm #5715
SteveKeymaster@gabeshackle– Thanks for the quick turnaround! We’ll test and make sure nothing else it effected.
Piklist is so big and can do so much, that testing can be a beast 😉
-
-
AuthorPosts
- You must be logged in to reply to this topic.