The images on the Galleries page are huge. There is only one column, with width=100%.

The Problem:
media_gallery uses hook_menu_alter() to modify the taxonomy/term/%term path callback function to build the Galleries page. Other modules are also overwriting this path callback and therefore specific gallery settings/styles can not be applied.

Known modules, which overwrite/conflict with media_gallery:
- i18n_taxonomy (Taxonomy translation)
- taxonomy_display #1811860: Support taxonomy_display module to prevent page callback overwriting
- page_manager (Chaos tool suite (ctools))

Related issues:
#1168358: taxonomy/term menu alter
#1301160: Media gallery breaks taxonomy panels
#1231170: Taxonomy translation (i18n) breaks display of gallery-collections page + missing some code
#1047970: Conflict with i18n_taxonomy: Gallery thumbnails stretch to full width of content area

Original Issue:
The images for the galleries are HUGE on the main page. Is this something I can change?

Comments

Moloc’s picture

The size of the thumbnails depends on the count of columns you define in the gallery setting. Increase the column-value and the images should be smaller.

Useful Idiot’s picture

Initially that worked for me, but now I am having the same issue. I have it set for 3 columns and 6 rows and it still is displaying only 1 column of large images. Please advise.

Moloc’s picture

What does "initially that worked for me" means? You had that problem and got rid of it by changing the columns. And now you have the problem again?

Does this issue occur on the "All Galleries" page?
Does this issue occur on a gallery node (viewing the media of the gallery)?
- Does this issue exist only, if the gallery is full (adding a new media will show the pager), or also, when there are only -for example- 2 images?
(Or does it occur on both: All Galleries and gallery-node?)

Do you have a public installation, where this error can be seen?

Useful Idiot’s picture

Hi Moloc, thanks for the speedy reply.

Sorry for my vague response.

I had the module installed and running properly. My main gallery page had 3 columns and 3 rows. Now my main gallery page is only showing 1 column no matter what I put the settings on. It seems the gallery nodes are still functioning properly , only the main gallery page that seems to have the issue. I only have 2 albums for now, so there was still room on the right side of the first row for another thumbnail when it was working.

I have a public install but it is under construction and in maintenance mode. If you'd like access I have no problem giving it to you. Just let me know. Thanks for the ultra-quick response.

Cheers!

Moloc’s picture

Which theme are you using? There seems to be a problem with some themes. See #1301374: Galleries no longer showing in columns & rows and #1230090: .media-gallery-detail img should not have width 100%.

Useful Idiot’s picture

Thanks for the links, seems to be an issue with adaptive themes. I'm using the most current version of corporate clean.

Moloc’s picture

I got the html-source from Useful Idiot and it seems, that the function media_gallery_list_galleries is not executed (you can see that on the missing html-elements, added by the theme media_gallery_collection function.

Now i am able to reproduce this bug. The submodule Taxonomy translation of the Internationalization module breaks the view.
Looking at the source code, we can find the following lines in media gellary:

142 function media_gallery_menu_alter(&$items) {
143   // Take over taxonomy term list pages by substituting our own callback.
144   // TODO: Use hook_entity_info_alter() to change the entity uri callback for
145   // gallery collections only.
146   $items['taxonomy/term/%taxonomy_term']['page callback'] = 'media_gallery_list_galleries';
147   $items['taxonomy/term/%taxonomy_term']['file'] = 'media_gallery.pages.inc';
148   $items['taxonomy/term/%taxonomy_term']['module'] = 'media_gallery';

The Taxonomy translation module uses the same hook and overrides the page callback. Therefore the galleries are shown in a wrong way on the "all galleries" page. So every module, overriding this lines may break the view too.

Solution: Maybe someone have a look on hook_entity_info_alter(), as described in the TODO statement.

NexusStar’s picture

I encounter the same problem with Views when enabled default taxonomy view it breaks the gallery output.
It happens because it overrides the HTML
here is the default output:

<div class="content clearfix">
      <div class="term-listing-heading"><div class="taxonomy-term vocabulary-gallery-collections" id="taxonomy-term-1">

 
  <div class="content">
      </div>

</div>
</div><div class="media-gallery-collection mg-collection-gallery_collections mg-col mg-col-4"><article id="node-media-gallery-1" class="node node-media-gallery node-teaser node-published node-not-promoted node-not-sticky author-admin odd clearfix" typeof="sioc:Item foaf:Document" about="/?q=node/1">
   
    <header>
        <h2 class="node-title" datatype="" property="dc:title"><a title="fadafa" href="/?q=node/1">fadafa</a></h2>
      </header>
   
   
 
  <div class="content clearfix">
    <div class="media-collection-item-wrapper"><img src="/sites/all/modules/media_gallery/images/stack_bg.png" class="stack-image"><div class="media-gallery-item"><div class="top"><div class="top-inset-1"><div class="top-inset-2"></div></div></div><div class="gallery-thumb-outer"><div class="gallery-thumb-inner"><a class="media-gallery-thumb" href="/?q=node/1"><img width="450" height="450" alt="" src="http://atri-old:8082/sites/atri-old/files/styles/media_gallery_thumbnail/public/180px_koala_ag1.jpg" typeof="foaf:Image"></a></div></div><div class="bottom"><div class="bottom-inset-1"><div class="bottom-inset-2"></div></div></div></div></div><a class="meta-wrapper cbEnabled hover" href="/?q=node/1"><span class="top slider"><span class="top-inner slider"></span></span><span class="meta-outer slider"><span class="meta-inner slider"><span class="media-title">fadafa</span><span class="media-description"><span>8 images</span></span></span></span><span class="bottom slider"><span class="bottom-inner slider"></span></span></a>  </div>
 
  <div class="clearfix">
          <nav class="links node-links clearfix"></nav>
   
      </div>
</article></div>    </div>

and here is the changed one

<div class="content clearfix">
      <div class="view view-taxonomy-term view-id-taxonomy_term view-display-id-page view-dom-id-ae58e4703b146ad25460ed0a8316f1fa">
        
 
 
      <div class="view-content">
        <div class="views-row views-row-1 views-row-odd views-row-first views-row-last">
    <article id="node-media-gallery-18" class="node node-media-gallery node-teaser node-published node-not-promoted node-not-sticky self-posted author-admin odd clearfix" typeof="sioc:Item foaf:Document" about="/?q=node/18">
   
    <header>
        <h2 class="node-title" datatype="" property="dc:title"><a title="adffafa" href="/?q=node/18">adffafa</a></h2>
      </header>
   
   
 
  <div class="content clearfix">
    <div class="media-collection-item-wrapper"><img src="/sites/all/modules/media_gallery/images/stack_bg.png" class="stack-image"><div class="media-gallery-item"><div class="top"><div class="top-inset-1"><div class="top-inset-2"></div></div></div><div class="gallery-thumb-outer"><div class="gallery-thumb-inner"><a class="media-gallery-thumb" href="/?q=node/18">PAG 2<img width="100" height="100" alt="" src="http://atri:8082/sites/atri/files/styles/media_gallery_thumbnail/public/PAG-2.jpg" typeof="foaf:Image">nothing</a></div></div><div class="bottom"><div class="bottom-inset-1"><div class="bottom-inset-2"></div></div></div></div></div>  </div>
 
  <div class="clearfix">
          <nav class="links node-links clearfix"></nav>
   
      </div>
</article>  </div>
    </div>
 
 
 
 
 
 
</div>    </div>

as you can see there is no wrapping div with classes (mg-col mg-col-4) that defines the columns anymore that way it all went on one column

lsolesen’s picture

Title:Huge Images On Main Gallery Page» Conflicts with other modules so media_gallery_collection not called which creates Huge Images On Main Gallery Page
lsolesen’s picture

In #1231170: Taxonomy translation (i18n) breaks display of gallery-collections page + missing some code a module has been posted that supposedly solves the problem. Should probably be reviewed.

lsolesen’s picture

@Moloc - do you have any idea on a safer way to get the callback in #7 executed.

Moloc’s picture

The patch, mentioned in #11 does not fix the issue (it just overwrites the callback and mixes i18n and media_gallery code together).

#12 No. I investigated some time with no solution. I read the entity api, but was not able to find a useable way to set a callback function.

dimitriseng’s picture

@Moloc, I am using the custom module mentioned in #11 and it is fixing the issue, but I agree that the way it does it might not be correct. From your comments in #13 it looks like you do not think that there is an easy way to resolve this. However, I think that this is very important for multilingual sites and that it will hopefully get resolved soon.

@all, anybody has any ideas? Thank you.

guillaumev’s picture

I think the way to fix this issue is to try to use a view for the main media gallery page instead of having a custom callback. I'm currently working on a patch going in this direction...

guillaumev’s picture

StatusFileSize
new11.68 KB

Here is a first patch. I removed the alias and menu in the install file because I don't think it should be the role of the media gallery module to define that...

This is a first shot for the view, and I'm sure there are lots of improvements that can be done on it...

lsolesen’s picture

Status:Active» Needs review
lsolesen’s picture

Status:Needs review» Needs work

I agree that having that page as a view will be the best solution. The patch seems to work. Have the following comments.

- uses the same url as the existing one, and thus it will not show the view when just applying the patch on an existing install. The patch should probably include a fix for that?
- it is not possible to alter the galleries link on admin/config/media/galleries to change that? Should that be included in the patch?
- the view uses the teaser view. Should it use fields instead?
- could it still be easy for the end user to alter the rows and columns from a central settings page instead of having to go to views?
- should the removal of the alias and menu in the install file be a separate issue?

What is your opinion?

lsolesen’s picture

Issue tags:+Beta9-blocker

Tagging

guillaumev’s picture

StatusFileSize
new12.08 KB

Isolesen > I'll try to work on a patch that includes the points posted in comment #18 when I have a bit more time. Meanwhile, here is the same patch as in comment #16, but that applies to the latest version of media_gallery.

lsolesen’s picture

Status:Needs work» Needs review
Issue tags:-Beta9-blocker+Beta10-blockers

@Moloc What is your take on this issue?

Moloc’s picture

Category:support» bug

It would be nice to use views - if it is possible. I think, this needs some more tests. There are some open questions:
- We need a dependency to views. (currently not in the patch)
- Does this solution work with the modules mentioned in #8?
- Does this solution work with multiple gallery collections? #1037002: New feature: Gallery containers
- If the users change the sorting of the galleries, will our drag-drop ordering still work? What do we have to change in this situation?

c0ldfury’s picture

The global settings no longer work with the patch (obviously) so can be removed, or linked to the view settings somehow.
Title on hover isn't working with the view either, although I'd imagine some custom CSS on the view fields will fix that.
Multiple galleries can be dealt with via an exposed filter on gallery collection field.

The patch certainly fixes the issue with ctools pages though, thanks.

lsolesen’s picture

lsolesen’s picture

Status:Needs review» Needs work
caspercash’s picture

I am using the 7.x-1.0-beta8 version of media_gallery and this issue still exists. Also the drag and drop functionality isn't working in the 'All Galleries' page but it works fine in the individual galleries. Any updates? Thanks for this great module!

lsolesen’s picture

Version:7.x-1.0-beta7» 7.x-1.0-beta8

Drag'n'drop is a different issue. Please look in the issue queue about that one. Also this issue is scheduled for a later release - look at the Roadmap. You are more than welcome to supply a patch which solves the problem.

Moloc’s picture

Issue summary:View changes

Update summary to describe the issue and the problem/conflict with other modules.

mtndan’s picture

Hi, the patch works great for the main Galleries view.

Should it also work for any user-created galleries? I'm still seeing the same issues.

Thanks

pinkonomy’s picture

Any news on this?

pinkonomy’s picture

I still have this issue for Media Gallery version 2 dev.
thanks

pauleb’s picture

This is way beyond my scope and I didn't test the 2.x branch but as far as the road map for media gallery and the tag on this issue show it will be addressed when working on 1.0-beta10. At least that's my interpretation.

Carlos Miranda Levy’s picture

Administration Views will also clash with media gallery and generate big thumbnails. If you disable it, you still need to disable created views as well to return to small thumbnails and Edit All Galleries tab.

Carlos Miranda Levy’s picture

Issue summary:View changes

Added taxonomy_display issue

pinkonomy’s picture

What should be done so as to integrate the patch with panels?

brantwynn’s picture

Version:7.x-1.0-beta8» 7.x-2.x-dev
Issue summary:View changes

I don't know if it is in scope to deal with this in the 1.x branch for the work I am currently doing. For now, I'd like to see about dealing with it in the 2.x branch.

I don't believe changing this to a View is a great idea, as it adds an additional dependency. It does make sense to me to make this a standard page callback.

I will see about working out a patch for 2.x that solves this. Once this is resolved for 2.x we can kick this back to 1.x for backporting.

mrfelton’s picture

vulfox’s picture

What is the current status?

SocialNicheGuru’s picture

Issue tags:-

WSOD is created because of this line because the patch deletes function media_gallery_list_galleries

media_gallery/plugins/content_types/gallery_list.inc:36: $block->content = media_gallery_list_galleries($context->data);

pj4ever’s picture

Applied this hotfix and deleted function media_gallery_list_galleries. how to get this function back?

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'media_gallery_list_galleries' not found or invalid function name in menu_execute_active_handler() (line 519 of /homepages/39/ddda/htdocs/clickandbuilds/Drupal/sitename/includes/menu.inc).