Closed (fixed)
Project:
Media Gallery
Version:
7.x-1.0-beta7
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2012 at 13:06 UTC
Updated:
17 Oct 2012 at 11:04 UTC
Jump to comment: Most recent file
Comments
Comment #1
moloc commentedThere are theme issues with media_gallery.
Theme issue: #1085486: Reorder collection - Drag and drop re-ordering patch fix nothing with omega subtheme
Sorting issue: #1228094: Gallery rearranging is not stored
Are you able to fix your issue with this two issues? The problem are the css-selectors in the javascript file (see patch in the mentioned theme issue).
Comment #2
m4r71n commentedYes, i gues so. I use fremework 3.x as base theme. I saw there is a fix (at http://drupal.org/node/1085486 #27 ) for this theme but not sure how to apply it to my theme. Can u give an advice? 10x again.
Comment #3
moloc commentedThe patch mentioned in #1 does not fix the problem with your theme.
Here is the solution for theme Framework. Tested with version 7.x-3.6.
File: media_gallery.dragdrop.js
replace line 18:
var $gallery = $('body.page-node #block-system-main .node-media-gallery .media-gallery-media > .field-items').once('media-gallery-sortable');with
var $gallery = $('body.page-node.node-type-media-gallery #main .content .media-gallery-media > .field-items').once('media-gallery-sortable');and replace line 80:
var $toReorder = $('#block-system-main [id^=' + data.idPrefix + ']').addClass('media-gallery-to-reorder');with
var $toReorder = $('#main [id^=' + data.idPrefix + ']').addClass('media-gallery-to-reorder');Now drag & drop should work.
Comment #4
moloc commentedFor those, who like patches, here it is. (For others, see comment #3).
Note: This patch works only with the Framework theme.
Comment #5
m4r71n commentedmany 10xs! Works like charm...
Comment #6
lsolesen commented@Moloc we should probably try to work out a method which works cross themes. Any ideas?
Comment #7
attheshow commentedAwesome. I was able to do the same two changes mentioned in #3 by Moloc for my own theme (using different classes and IDs that were specific to my theme) and it got the drag and drop working perfectly. Thanks!
I do agree that not forcing themers to correct this JS file would be ideal though.
Comment #8
moloc commentedSo lets see, what do problem is:
Some HTML5 themes use article instead of node. Therefore we cannot use body.page-node and .node-media-gallery.
Other themes use #main instead of #block-system-main, so we can't use that too.
Next, i tried to add some code to media_gallery_preprocess_node():
That was fine, except with the Framework theme. The Framework theme does not print the classes for the node in full view. :/
--------------
What does the selectors do:
The selectors try to find only the media-thumbnails, which are in the current node (full view). So if there is another block with media-thumbnails, then they should not be draggable.
For the final solution, see patch.
Tested with all mentioned themes: Bartik, Adaptive Theme, Framework, Omega, Andromeda, Sky
Comment #9
lsolesen commentedReviewed and committed.
Comment #10
mrpauldriver commentedThere doesn't appear to be a dev version for media gallery module.
Any ideas when this will find its way into a beta release?
Comment #11
lsolesen commentedi cannot say at the moment. we are working hard. you can help by reviewing other issues.
Comment #13
mrpauldriver commentedI'm using the Dev version from 2012-Sep-25, but unfortunately this bug is not fixed for me.
I am using Omega theme.
Any pointers?
Comment #14
elgandoz commentedWith omega theme the problem is MG use classes to identify sortables, but omega (and so other themes I think) change these.
Change the _media_gallery_sanitize_ids function in media_gallery.pages.inc in this way:
Comment #15
elgandoz commentedAs this is still present in the 7.x-1.x-dev of 2012-Oct-09 with omega theme (widely used: October 7, 2012 --> 30,486 ), I'm reopening
Comment #16
moloc commentedThis issue fixed the draggable handler.
Your issue is #1701690: Cannot reorder galleries on the galleries page (SQL error). Therefore i close this again.