I don't have the option to re-order my galleries or my images in the gallery itself. All that is shown the edit/remove for each image in my gallery.

I have installed the modules on a local testing site and on my hosting service with a fresh install.

I am using the last releases of the modules with the field_info_max_weight and plupload-workaround patches. Any ideas?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aka006’s picture

I had the same problem when using the http://drupal.org/project/sky theme, however when I switched to the Bartik D7 theme I got the draggable images. I guess the ability to drag and drop is theme dependent?

szeidler’s picture

Maybe you have an modified field.tpl.php in your theme directory?

Create an gallery field template (field--media-gallery.tpl.php) with default field.tpl.php content:

<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  <?php if (!$label_hidden) : ?>
    <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;</div>
  <?php endif; ?>
  <div class="field-items"<?php print $content_attributes; ?>>
    <?php foreach ($items as $delta => $item) : ?>
      <div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div>
    <?php endforeach; ?>
  </div>
</div>
ar-jan’s picture

I have the same thing, using an unmodified Sky theme. There is no field.tpl.php in the theme. Your suggestion did not make it work either. (In D7, is it no longer necessary to add e.g. field.tpl.php when you want to override something using field--media-gallery.tpl.php?). Could this be due to Sky, or maybe another module?

rggoode’s picture

Version: 7.x-1.0-beta3 » 7.x-1.0-beta4

I'm having the same issue. I'm using Media Gallery 7x-1.0-beta4 and Omega 7.x-2.1 as my theme. If I switch to Bartik, I can re-order galleries, and images within galleries as expected. There are also a few other anomalies when I'm in the (preferred) Omega theme--like the Galleries stack vertically in a single column on the main gallery page, rather than lining up inline in columns and rows.

Before I start adding changes to .tpl files in my sub-theme, is there work in progress to normalize this for use with most themes, or is the theme modification going to be necessary going forward.

The nature of my gallery is such that I don't need to update it that often... so I can just switch themes to do the basic re-ordering and switch back. No biggie. But longer term, if this is how the module will interact with my theme of choice, then I'll probably make the modifications.

MrPaulDriver’s picture

I am having the same problems as rggoode at #4 - likewise with omega theme.

MrPaulDriver’s picture

Media Gallery's drag and drop reordering remains a problem with the Omega theme as well as the vertical stacking of galleries under Drupal 7.

Confirm that solution at #2 does not appear to be valid with Drupal 7.

A post at http://drupal.org/node/1122730 discusses some of the issues.

I wonder whether one of the maintainers could find time to take a closer look at this issue?

EDIT:
I should say that the a css fix mentioned here http://drupal.org/node/1114582 addressed the vertical stacking issue.

However with 'media_gallery 7.x-1.x-dev' this is now broken as it causes image thumbnails to shrink below their default sizes to about 10 pixels square making the module unusable with the Omega theme.

wrd’s picture

I've added some notes here on how to make that CSS fix work without breaking the image thumbnails. Works for me, at least, may be worth a try.

Also found that drag-and-drop reordering works on the main galleries page; it only breaks on the individual gallery pages. If we can figure out what's different about the two, some kind of fix should be possible.

wrd’s picture

Edit: Ignore what I wrote earlier (below this point). Correct solution, I think, is a small change to a file in Omega.

Posting this here as well as in the Omega issue. What's happening is that the jQuery selector that wraps the gallery in the necessary ui-sortable code is failing to match Omega's HTML5 output.

If you change line 18 in media_gallery.dragdrop.js to:

var $gallery = $('body.page-node #block-system-main .node-media-gallery .media-gallery-media > .field-items, body.page-node #block-system-main article .media-gallery-media > .field-items').once('media-gallery-sortable');

...it should work in both Omega and other themes.

The why of this is a mystery to me. Omega's output looks correct - the article tag is correctly classed as "node-media-gallery", so the original selector should match it. It kind of looks as if jQuery isn't looking for classes on article tags.

Jeff Burnz’s picture

subscribe

korund’s picture

Version: 7.x-1.0-beta4 » 7.x-1.0-beta5
FileSize
103.74 KB

i have the same issue as in #4 with Deco theme. also i tried fix from #8, but nothing happened.
also there is a little bug with outlook - part of the title is out of the block, as it is shown on the picture.

thinkdrupal’s picture

I find that you can only reorder the images on the galleries page one time. Afterwards, it does not work.

totap’s picture

I've tested that Sky theme - it seems that Media Gallery is theme dependent. I don't know what and where something is different but with some themes i.e. Sky theme you can't drag and drop rearange pictures in galery.

Edit: tested on 7.x-1.0-beta6, Drupal 7.7

MrPaulDriver’s picture

Just a bump.

A reminder that drag and drop reordering of galleries (on main galleries page) is still broken with Omega theme.

Cross posted at Omega

Plazik’s picture

I had the same error on my custom theme. I edit 18 line on media_gallery.dragdrop.js and it is works fine for me.
Original:
var $gallery = $('body.page-node #block-system-main .node-media-gallery .media-gallery-media > .field-items').once('media-gallery-sortable');
My edit:
var $gallery = $('body #block-system-main .media-gallery-media > .field-items').once('media-gallery-sortable');

broeker’s picture

After some digging I was able to get this working on all themes (tested with Omega and Bartik/Stark) by making two small changes to media_gallery.dragdrop.js:

Change line 18 from: 

var $gallery = $('body.page-node #block-system-main .node-media-gallery .media-gallery-media > .field-items').once('media-gallery-sortable');

to:

var $gallery = $('body.page-node .node-media-gallery .media-gallery-media > .field-items').once('media-gallery-sortable');

and then:

Change line 81 from: 

var $toReorder = $('#block-system-main [id^=' + data.idPrefix + ']').addClass('media-gallery-to-reorder');

to:

var $toReorder = $('body.page-node [id^=' + data.idPrefix + ']').addClass('media-gallery-to-reorder');

The problem in both cases was #block-system-main selector -- apparently this is not present in all themes (including Stark from core and Omega). To be honest I have no idea where it originates or its purpose in life but without it sorting seems to work with Bartik, Stark, Omega, et al.

I'm not sure if this change affects anything else and would appreciate a comment from a maintainer if this is going to break anything and if it can be rolled into dev -- happy to roll a patch if you want one for this small change.

broeker’s picture

Here is a patch against 7.x-1.x that incorporates #15

MrPaulDriver’s picture

good work thank you

c31ck’s picture

Status: Active » Reviewed & tested by the community

Patch applies cleanly and fixes the problem. Thanks.

phoenix’s picture

I can confirm this patch fixes the problem.

citywizz’s picture

Title: Drag and drop re-ordering » Reorder collection - Drag and drop re-ordering patch fix nothing with omega subtheme

DOException : SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'weight' at row 10: INSERT INTO {media_gallery_weight} (tid, nid, weight) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2), (:db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5), (:db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8), (:db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11), (:db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14), (:db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17), (:db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20), (:db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23), (:db_insert_placeholder_24, :db_insert_placeholder_25, :db_insert_placeholder_26), (:db_insert_placeholder_27, :db_insert_placeholder_28, :db_insert_placeholder_29); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => 15 [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 18 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1 [:db_insert_placeholder_7] => 19 [:db_insert_placeholder_8] => 2 [:db_insert_placeholder_9] => 1 [:db_insert_placeholder_10] => 25 [:db_insert_placeholder_11] => 3 [:db_insert_placeholder_12] => 1 [:db_insert_placeholder_13] => 21 [:db_insert_placeholder_14] => 4 [:db_insert_placeholder_15] => 1 [:db_insert_placeholder_16] => 20 [:db_insert_placeholder_17] => 5 [:db_insert_placeholder_18] => 1 [:db_insert_placeholder_19] => 22 [:db_insert_placeholder_20] => 6 [:db_insert_placeholder_21] => 1 [:db_insert_placeholder_22] => 17 [:db_insert_placeholder_23] => 7 [:db_insert_placeholder_24] => 1 [:db_insert_placeholder_25] => 24 [:db_insert_placeholder_26] => 8 [:db_insert_placeholder_27] => 1 [:db_insert_placeholder_28] => 0 [:db_insert_placeholder_29] => ) dans media_gallery_reorder_collection() (ligne 203 dans /home/webservices/http/mysiste.com/sites/all/modules/media_gallery/media_gallery.pages.inc).

Media Gallery 7.x-1.0-beta7 + Omega html 5 or xhtml subtheme

The reorder works with main theme Omega on sites/all/themes/omega/

Drag and drop worked in the subtheme maybe until i disabled one of my galleries...

sashkernel’s picture

I've got same issue with Andromeda theme.
Applied fix described in post #15, but nit did not help :(.

Moloc’s picture

Status: Reviewed & tested by the community » Needs work

#20 your issue is related with omega. Patch in #1188658-3: Cannot change media order | theme conflict should solve your issue (tested with latest media_gallery and Omage version).

#21 For the Andromeda Theme you just need to remove the "body.node-page " string. (Tested with Andromeda 7.x-2.x-dev)

#16 The patch may work, but if you reorder gallery-nodes in the collection view, the page always get reloaded. The edit in line 77 is wrong, because you filter to body.node-page. In collection view this is body.page-taxonomy-term. Therefore i set this to "needs work".

You all may also need to apply the patch in #1228094: Gallery rearranging is not stored, if you like to reorder galleries in the collection view.

sashkernel’s picture

Re-arranging media now works as per Moloc's instructions.

leaving code look like this:

var $gallery = $('.node-media-gallery .media-gallery-media > .field-items').once('media-gallery-sortable');

And

var $toReorder = $('[id^=' + data.idPrefix + ']').addClass('media-gallery-to-reorder');

If I remember correctly from manual Re-arranging galleries should be working the same way, shouldn't it? I don't get those on my site.

hacor’s picture

Hello,

I have the same problem using the Media Gallery in a Drupal 7.10 version using the AT Commerce theme. I can not rearrange the media gallery items because I don't see the arrow icon. I checked that the main content block was activated and I made the Javascript changes as proposed in post #15: sunflower.theme: incorrect "teaser" / "read more" handling but still no effect.

Any help would be appreciated!
Thanks,

Best regards

Hacor

eridolfi’s picture

I'm using beta 7 and the framework theme and this issue seems to be present as well. I applied the patch and it did not fix it for the framework theme.

mfgr’s picture

I have an Omega subtheme and Media Gallery (beta7) and tried everything suggested on this page, but it doesn't help in reordering the galleries on my page. I do have a snazzy blue drag & drop image during hovering now, which I guess is a bonus, but I would prefer it if I could actually reorder the galleries.

Thomas Bosviel’s picture

Version: 7.x-1.0-beta5 » 7.x-1.x-dev
Status: Needs work » Needs review
FileSize
1.41 KB

This patch works with Framework 7.x-3.6

eridolfi’s picture

Patch failed for me. I applied the patch for the Omega theme, could that be the issue?

nickgs’s picture

This still seems to be a problem. The issue here is that the selectors we are using are not always available in the themes we are using. #15 and #27 will work for some of us depending on the theme enabled. Ideally I would think these selectors should only rely on markup that the media OR media_gallery module exposes to us.

In my case I am using Sky, the class .node-media-gallery is .article-media-gallery which is reflective of its HTML5 nature.

Attached is a patch that tries to address this. It much like #15 and #27 but attempts to provide a more general selector to attach to. What I am not sure of is if we are able to be this general without breaking things for other use cases I am not thinking of.

Thanks

Nick
http://nickgs.com

lsolesen’s picture

@nickgs Which themes have you tried your patch with?

lsolesen’s picture

Status: Needs review » Closed (duplicate)