Viewing 10 reply threads
  • Author
    Posts
    • #4004
      ndmurph04
      Member

      Hi 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!

    • #4009
      Steve
      Keymaster

      @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.

    • #4086
      ndmurph04
      Member

      Hey 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

    • #4090
      Steve
      Keymaster

      @ndmurph04– I sent you an email with instructions and latest beta. Thanks for contributing to Piklist!

    • #5689
      Gabe Shackle
      Member

      Has 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”

    • #5690
      Gabe Shackle
      Member

      A 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.

    • #5695
      Gabe Shackle
      Member

      I’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.

    • #5696
      Gabe Shackle
      Member

      Looks like ZIPs don’t work either so I’ve posted the updated admin.js here: http://hereswhatidid.com/media/admin.js.zip

    • #5697
      Steve
      Keymaster

      @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.

    • #5698
      Gabe Shackle
      Member

      Ah, 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)

    • #5715
      Steve
      Keymaster

      @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 😉

Viewing 10 reply threads
  • You must be logged in to reply to this topic.