Closed (fixed)
Project:
Media Gallery
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Dec 2010 at 00:54 UTC
Updated:
31 Aug 2011 at 21:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
Womp commentedThis is a bit more than a 'minor' issue in my opinion. If you do not have clean URLs, media is not properly attached to the gallery node that you save it to (media_gallery.addimage.js). If that first issue is fixed, all ordering of media in the display does not save if moved around (media_gallery.dragdrop.js).
The current code in media_gallery.addimage.js that doesn't work for me is:
This fix worked for me and should work for those with clean URLs as well (let me know what you think because I never touch JavaScript compared to PHP). I replaced the code above with:
If my code is appropriate, I could add a variation to media_gallery.dragdrop.js as well.
-Womp
Comment #2
tamasd commentedI have rolled a patch against the latest beta and it works for me. Could you add the media_gallery.dragdrop.js support to the patch?
Comment #3
David_Rothstein commentedThanks for the patch.
I haven't tested and only reviewed quickly, but i think the normal way to deal with this kind of thing is actually to define the URL entirely on the PHP side of the code (in which case the Drupal url() function can be used which takes care of clean URLs and everything automatically for you).
Then add that variable as a JavaScript setting using drupal_add_js(), and access it on the JavaScript side via
Drupal.settings.addImageUrl(or whatever the variable was called).Would that approach work here?
Comment #4
temaruk commentedPatch against latest dev, fixes the issue in PHP side using Drupal's url() function, and passing it as a js setting (
Drupal.settings.addImageUrl). Only for media_gallery.addimage.js.Comment #5
David_Rothstein commentedThanks! I added code to fix media_gallery.dragdrop.js in a similar way (and also to remove some of the extra JavaScript settings that were no longer needed after this patch) and committed it:
http://drupalcode.org/project/media_gallery.git/commit/7d68fbf
The Media Gallery module should now work even on servers that don't support clean URLs.