I currently have a site setup on a multisite install using ACF and the Gallery Add-on. I am unable to drag the images in grid mode to reorder them. I have the most recent versions of both plugins running on WP 3.6.1.
I’ve used the Gallery Add-on before and not run into any issues in the past. The plugins are only activated on the subsite, not network activated. I don’t see any js errors in Chrome Developer Console.
Otherwise it works as it is supposed to. Any ideas?
Can you please try this in firefox and check the firebug console log for any errors on page load or when you drag an image.
Next, check if the gallery field .js file is being included correctly on the page and that the sortable .js file is included in the wp-load-scripts file.
I think I found the culprit. In Firefox I get the following:
Then, I went and looked at my Location Rules.
When I changed the second rule to a different Logged In User Type so that it didn’t apply to the user anymore, then the sorting of images in gallery field work. Once I set it back to the logged in user type for that post I get the above message in Firefox console.
Does that help?
Just to clarify, when you change the field group location rules so that the field group does NOT show on the page, the gallery field works correctly?
If this is so, perhaps you have a PHP error on the page (from this field group) that is causing the issue in the gallery field.
Please check your source code for any errors and check your console log for any JS errors – not just AJAX calls.
Actually, the gallery field will show and work on the post with the top location rule and work fine. Once I add that second rule in for the Logged in User Type then I can longer drag the images to sort when I add a new post.
Here is a screencast showing it not working and working: ACF Gallery Sorting
Just a note on the video — the user is a Contributor but does the same for any other role too, i.e. Author. And, as Admin if I go in to the post that field is still locked by WordPress.
Also, when I turn on WP-DEBUG I only get notices. Here is a screenshot of those.
I still believe there is a JS error on the page, your screencast shows that you opened the console log after adding the images.
What you need to do is open the console log from the very start of the page – before the page has loaded.
Can you try this and report any JS errors?
I had the console open from when I add new post and there are no errors whatsoever.
Here is the Screencast.
I even changed the user to Author to make sure it wasn’t a problem with Contributor not having publishing rights. And, now I just have the one rule.
I tested it on another subsite of the multisite and same problem. But on a local install it works fine 🙁 I may setup a multisite locally to see if I can create the error. I think it comes back to WordPress post lock message from my first post in the thread.
Let me know if you have any more ideas and I’ll let you know how it goes on my local multisite install.
Thanks for the screencast. Are you able to check the source of the post-new.php page for the sortable .js file.
Perhaps you have another plugin / theme code which is preventing this file from loading?
Does any other drag / drop functionality work on the edit page? Can you try adding a relationship field to the page and selecting / re-ordering some items?
The only sortable in the post-new.php file is in this script line
jquery-ui-sortable is there but I don’t know if that is what you are looking for.
Also, I added a relationship field and the sorting doesn’t work. I also took off the content editor so it wouldn’t display incase it was a plugin adding a button to the visual editor but that didn’t make a difference.
I’ve disabled all the plugins and changed theme to default Twenty Twelve but still had the issue. That ruled out functions I have in my child theme.
It’s the Logged in User in the location rules that is causing the issue. When I don’t have that rule it works. It’s baffling but has to be something I am doing. Ugh.
I’m going to try and work this the other way. I’m going to build the site up from a clean single install and see if I still have the problem.
I’ll let you know if it works.
I’m having this same exact issue on a site. Can’t re-order images. I cannot replicate the “fix” above by implementing user permissions. I just can’t re-order images in the gallery. I can, however, reorder other items on the admin page, so the sortable script is functioning properly.
Any solution to this yet?
Did the above already. There is one error that is present on the front and admin panel: Error is
[Error] TypeError: ‘undefined’ is not an object (evaluating ‘playerDiv.addEventListener’)
global code (main.js, line 86)
However, this error is present on our sites where we can re-order images, plus, you can see this exact error at http://bxslider.com too, so that’s not likely the issue.
SortableJS is being loaded, and we can re-arrange boxes in the admin. Just not the gallery images. Happy to give you an admin login so you can see the issue for yourself if you want to email me.
Thanks for your help!
FYI I did some testing and it seems it’s the same problem as here:
i.e. the Gallery field thumbnails are only draggable if the acf_form displaying the field group containing the gallery field is the first acf_form on the page.
For what it’s worth, a customer just reported they can no longer order images properly. They are able to sort them in the backend, hit Update and the order is gone again. Also, all galleries on the frontend are in the wrong order. I am very familiar with the Console, and there is not a single error, and no rules relating to users being logged in or something.
In my case, it actually was real easy. Another plugin responsible for drag’n drop re-ordering of posts and CPT items interfered with ACF. Once I disabled it, ACF worked flawlessly and as before. Just for those who have problems with re-ordering not being saved in the backend may just look out for some faulty plugin.
The topic ‘Can't Reorder Images in Gallery’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!