Hi nicovideo,
If you view the post/page first, then go back to the visual editor do the icons now display?
-Dan
Hi,
No, unfortunately, I just see the name of the documents, no icon.
nicovideo,
Hmm… can you link me to a page where you’ve got a gallery setup? I have an idea, but I’ll need to look at the gallery to confirm.
-Dan
I can’t show you the website, because it’s not yet on a public network.
But here are some screenshots:
– The editor
– The thumbnails manager
– The result on the page
I’m able to dig into the code if needed, just tell me where to explore.
Ok. The thumbnails are only added to the list in thumbnail management after a gallery fully loads on the front end. After the page loads, AJAX requests are sent for any thumbnails not yet generated in the gallery.
I’m wondering if you’ve got a JavaScript error resulting in these AJAX requests never being sent. If you open the browser console (generally hitting F12 will do this), then load a page with a gallery, what if anything is logged in the console?
-Dan
There is no error, in the editor or in the displayed page.
I checked the console and the network tab.
Hey!
I just noticed a JavaScript error on adding a new document gallery to my test galleries page:
VM83073:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
Could this be a way to solve the issue?
I recently updated DG, to see if it may solve the issue.
Instead of that, the new behaviour is that it loads infinitely in the editor. So everything goes worst…
Any idea…?
Hi nicovideo,
In answer to your previous question, yes that could absolutely be the cause. Which JS script is resulting in that error? If you disable plugins other than DG does it go away?
Is the error still present after the upgrade?
-Dan
I didn’t see the error for a while, so I guess it was not relevant.
I am really worried about this feature, because I don’t really have the time to find another plugin solution…
I may try to properly reinstall DG. It’s the last test I didn’t try yet.
Ok. If you are able to get a setup where I can actually see what’s happening I may be of more help, but working blind I’m about out of things for you to try.
Since I’ve not heard of issues like this arising before, I’m inclined to believe you have something else (plugin/theme) that is not playing nicely with DG. Have you tried disabling all plugins except DG, switching to a default theme, and checking if the issue persists?
-Dan
I reinstalled DG, then disabled all my other plugins… and I see no difference at all.
Could the cause be about permissions on some folders?
Unfortunately, I may consider find another solution, though I don’t doubt about how great your plugin is.
Hi,
Finally, I’m digging in the code to find the bug…
It seems that the hook function “generateIcons” is not called on a new gallery creation.
I guess “wp_ajax_dg_generate_icons” or “wp_ajax_nopriv_dg_generate_icons” is not fired.
Do you have any idea, while I keep digging, deeper and deeper?
EDIT : There is no occurrence of these two terms in my whole plugin folder, except for the ones in class-ajax-handler.php. Does it seem normal?
-
This reply was modified 9 years, 6 months ago by
nicovideo.
HURRAY!!!!!
I found out what caused this strange behaviour.
1 – I redesigned in functions.php the thumbnail render, just getting the src and ignoring the data-* attributes… shame on me!
2 – My MCE editor is in an iframe, which prevent the gallery.js JQuery selector to work.
So I will correct my hook, and I just replaced :
$('.document-gallery img[data-id]').each(function() {
by :
$('#content_ifr').contents().find('.document-gallery img[data-id]').each(function() {
in gallery.js… and gallery.min.js.
Can’t believe this little JS line currently solve this long-time issue…
Thank you for your support anyway, I would definitely recommend this plugin!
nicovideo,
I apologize for disappearing from this thread! With the ww.wp.xz.cn forum migration, threads I’d subscribed to lost the subscription so I never got an update when you posted.
I’m thrilled you found a solution to your problem. That’s an interesting one… The one thing you’ll need to be careful of is that you re-make that change to gallery.min.js whenever you install a DG update, but given how much work you put into figuring this one out, I bet you won’t forget π
FYI, if you’re running in production, you will probably only need to change gallery.min.js — gallery.js will never be loaded.
-Dan
EDIT: I almost forgot to mention, plugin ratings, especially of the 5-star variety, are greatly appreciated! π
-
This reply was modified 9 years, 6 months ago by
Dan Rossiter.