navigation blocks and primary links disappear in gallery

matb - March 2, 2008 - 16:46
Project:Gallery
Version:6.x-1.x-dev
Component:Module: Gallery Menu
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

drupal 6.1
module gallery from cvs ( -r DRUPAL-6--1)
gallery latest svn (Revision: 17490)

As soon as I enter the gallery the navigation blocks on the (left) side bar disappear.

In Gallery settings I have enabled:
Move Gallery2 sidebar to Drupal Gallery Navigation block
Move Gallery2 Admin sidebar to Drupal Gallery Navigation block

but it is the same with disabled items.
It is also independent from the selected theme (default or custom).

Additionlly the primary links are not displayed any more and the menu on top is lacking the album names. I have attached a screenshot to clarify the issue.

AttachmentSize
gallery.png135.26 KB

#1

lexthoonen - March 17, 2008 - 12:08

same here, but in fact: the 'gallery home page' is fine. As soon as I click on an album, or an image, that's when 'primary links' and the drupal navigation disappear. I get the gallery bread crumbs, but that's it as far as navigation is concerned.

See it here: http://www.fotogeorgeburggraaff.nl/?q=gallery

Any ideas how to solve it?

#2

lexthoonen - March 18, 2008 - 17:17

When I disabled rewrite rules plugin in gallery2, I got my menus back in drupal 6.

#3

kuber - March 23, 2008 - 01:01

Same here. My problem is the same as lexthoonen : The front of the gallery is fine until I click on an album. All blocks are then gone except the gallery menu and image blocks, and gallery breadcrumbs.

I tried disabling rewritte rules in galery2 admin but did not solve my problem.

http://bellwellcharters.com/gallery

I notice from the link above that you figured out the fix. Can someone please give me some advice?

Thanks

EDIT:

I got it to work when I uninstalled the rewrite rule plugin. It didn't fix the problem when I had only deactivated it.

#4

matb - March 26, 2008 - 00:28

Thanks for the hint, lexthoonen!
When deactivating URL rewrite in gallery2, I also get back primary links and drupal navigation. Nevertheless no gallery menu so far.

#5

sparr - April 11, 2008 - 05:26

line 476 of gallery.module, comment out the following:

drupal_alter('gallery_page', $result, array());

this fixed the problem for me, for now. thanks to takahiro in #drupal-support

#6

profix898 - April 11, 2008 - 08:33

I will take a look at this as soon as time permits, but commenting that line prevents gallery_menu from working correctly ;) Means its more a bad workaround than a real solution ...

#7

haggan - May 25, 2008 - 09:05
Version:6.x-1.x-dev» 5.x-2.x-dev

Got the same problem on the 5. dev version.

When deactivating URL rewrite in gallery2, I also get back primary links and drupal navigation

#8

castle9mm - September 30, 2008 - 22:09

Same here. Disabling and uninstalling 'URL Rewrite' in gallery2 admin worked and I'm getting my menus back.

EXCEPT for when I view a virtual tag album. Example:(nav bar is in the blue)

Viewing album content works
http://www.castle9mm.com/index.php?q=gallery&g2_itemId=576

Viewing tag cloud itself works
http://www.castle9mm.com/?q=gallery&g2_view=tags.TagCloud

Viewing a tag virtual album disappears
http://www.castle9mm.com/index.php?q=gallery&g2_view=tags.VirtualAlbum&g...

Quest continues...

#9

placlair - October 31, 2008 - 14:25
Version:5.x-2.x-dev» 6.x-1.x-dev

Has anyone found a fix for this? I have a completely fresh install, with all of the latest versions of Drupal, G2, and this plugin (dev), and while everything appears to work fine, the instant that I browse into an integrated sub-album, my primary links, navigation menu, and footer all disappear (they're all there while browsing the main album). I've tried everything that I can think of (changing themes, disabling clean urls, re-installing this plugin, verifying that the blocks are visible for everyone on every page, turning off the integrated G2 nav menu), and I simply cannot get it working properly.

Many thanks in advance for any assistance that you can offer.

EDIT: My problem was that I'm an idiot and didn't read the directions well enough (I found G2's drupal implementation guide very helpful...wish I had seen it before). In my case, I think that my main was problem was that I had named my G2 folder "gallery" (within the root of drupal). I didn't realize that this was a no-no. After uninstalling everything, renaming the gallery folder to gallery2, then re-installing/enabling everything, it all works great.

#10

mitoman - November 6, 2008 - 16:38

I have the same problem at my site. It can be fixed by turning off the url rewrite module. But is that really the best way to go? I can do that and leave it that way. But it would seem to me thats more of a work-around instead of a solution.

I'd love to help someone fix this, but I have no serious coding skills. If this is the best/only option I can use it. But I was wondering if anyone knows of a better solution I can try.

Also, what exactly does it do to turn off the URL rewrite module? Can it cause problems?

Thanks all.

---
Using Drupal 6.6
Gallery Integration module 6.x-1.x-dev
Gallery 2.3

#11

lvthunder - November 6, 2008 - 16:44

All the URL rewrite module does is shorten the URL's.

#12

djphaezer - December 16, 2008 - 16:49

I fixed this problem today!!!

Setting up URL ReWrite

Here's what I did (all through the embedded Gallery2 interface in Drupal). I already had all the features of Gallery2 working within Drupal 6.8, the only problem was that the menus would disappear in sub albums when I had URL Rewrite enabled in Gallery2. Therefore I had disabled URL Rewrite in Gallery2. However, I happened upon a solution to this problem, which has to do with the order of installation.

1) "Install" URL Rewrite plugin for Gallery2 (Gallery -> Site Admin -> Plugins -> scroll down to URL Rewrite -> Install)

2) Configure URL Rewrite plugin (Gallery -> Site Admin -> Plugins -> scroll down to URL Rewrite -> Configure)
- a) Select Apache mod_rewrite and then in the setup:
- b) Absolute path to the folder of your embedded .htaccess: Put the absolute path of your Drupal installation here, for example, "/homepages/01/1234567890/htdocs/mysite"
- c) Please enter the Url to your environment: Just put a "/" here assuming you're using a domain
- d) Save the settings

3) Activate the URL Rewrite plugin (Gallery -> Site Admin -> Plugins -> scroll down to URL Rewrite -> Activate)

4) Once URL Rewrite is activated, refresh the embedded Gallery2 Site Admin page and click on "URL Rewrite" in the left hand menu (instead of scrolling down to it in the list like you were before). As discussed here (http://codex.gallery2.org/Integration:Drupal) you have some changes to make under the "Rules" tab of the URL Rewrite options.
- a) Only have "show item" enabled
- b) Set the "show item" URL Pattern to: "gallery/v/%path%" instead of "v/%path%"
- c) Save the settings

So far, it still didn't work. Then I tried this - reinstalling the Gallery2 Drupal Module.

4) Go to "Administer" -> "Site Configuration" -> "Gallery Settings"
- a) Click on the Install tab
- b) Go down to the bottom and click "Reset and Restart"
- c) Go through the installation again
-- i) PHP Mem test.

-- ii) Gallery2 Location settings. I used the auto settings:
Gallery2 URL or URI: "/gallery2/"
Gallery base (optional): "gallery" <- note that this has to be the same so that "gallery/v/%path%" will work
Once you're done hit 'test location settings' to move on

-- iii) Let's hope all your modules are already set up properly

-- iv) Public path to your .htaccess file: set it to "/" assuming that's true for your site
Filesystem path to your .htaccess file: set it to same as above but with a slash on the end, for example "/homepages/01/1234567890/htdocs/mysite/"
Once you've done that hit "configure url rewrite plugin" to proceed

-- v) Hit 'sync users / groups' to proceed.

#13

williamhdean - December 21, 2008 - 13:24

Worked like a champ! Thank you.

#14

decomposer - May 23, 2009 - 22:33

This works great but you have to follow every step. Don't be afraid to deactivate and uninstall the URL Rewrite module so you can reinstall it. If you don't do it, this will not work (I tried).

Only problem is I had links to multiple albums and this changed the links so I had to relink.

#15

thutchis - August 5, 2009 - 23:07

THANKS! Worked great and fixed another problem I had with embedded Gallery2. Unfortunately my "clean URL's" are now broken and I had to disable them.

Oh well, something else to fix.

#16

Joel MMCC - August 12, 2009 - 16:45

Warning to All!

From Post #12:

4) Once URL Rewrite is activated, refresh the embedded Gallery2 Site Admin page and click on "URL Rewrite" in the left hand menu (instead of scrolling down to it in the list like you were before). As discussed here (http://codex.gallery2.org/Integration:Drupal) you have some changes to make under the "Rules" tab of the URL Rewrite options.
- a) Only have "show item" enabled
- b) Set the "show item" URL Pattern to: "gallery/v/%path%" instead of "v/%path%"
- c) Save the settings

Doing this step on my test server (Mac OS X running MAMP) blew up the test server.

Not just Gallery embedded in Drupal.

Not just Gallery.

Not just Drupal.

The whole MAMP installation! Everything hosted on it!

Every page I go to: even other unrelated sites hosted on the MAMP server, even the MAMP informational and administrative pages, even straight .HTML pages (not just .PHP), even from the host machine itself (localhost) — gives this immediately:

Internal Server Error

The server encountered an internal error or
misconfiguration and was unable to complete
your request.

Please contact the server administrator,
you@example.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.

More information about this error may be available
in the server error log.

Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2 Server at kog.local Port 80

Even stopping and restarting the MAMP dæmons doesn’t fix it!

Good thing I had a test server! Heaven help me if this had happened to my shared hosting service! (I would hope that they have protections against this sort of thing, but still!)

Where does one go to find the server logs in MAMP?

#17

Joel MMCC - August 12, 2009 - 17:21

Sorry for the delay in updating. I have other projects to work on, too.

The Apache logs show this: “RewriteBase takes one argument, the base URL of the per-directory context.”

I’ve tried replacing the .htaccess file (which had the line “RewriteBase /” — which looked perfectly fine to me, having just one argument and it being a valid path) with the working one on the hosted domain, to no avail.

I then searched for every occurrence of “RewriteBase” on the entire Mac, and found it in a “.tpl” file located deep in what appears to be a Gallery2 theme cache file, but nowhere else except in documentation. I didn’t dare try to edit that.

(Edited):

Found the answer!

For some reason, a “.htaccess” file got written to the root of my Mac hard drive! Not just the root of the MAMP installation. It had a “RewriteBase” with no arguments. Deleting that file brought my server back!

This is still pretty scary: why would setting something in the Gallery2 Admin write a file to the SystemRoot!? I would hope that my shared hosting service has protections against that, but am afraid to try it!

I will continue with the instructions in Post #12 and see if it brings my Drupal Primary Links menu back on my MAMP test server, but again, am afraid to try it on the live server. It would get a lot of people miffed at me if such a file got written to SystemRoot on a live shared hosting server! At least I could tell the hosting service what happened, but still, bringing down lots of other sites would make me, well, unpopular.

#18

daveinakilt - September 13, 2009 - 23:01

Thanks for the fix, djphaezer, it worked perfectly!!

#19

attilahooper - October 12, 2009 - 15:57

+1. Worked on my Ubuntu jaunty Lamp, drupal 6, gallery2.

I did not have to reinstall the gallery2 drupal module. just change gallery base to /

thx

edit: ok, this worked on my base or root album. But sub-albums still break nav sidebar. any hints on how to relink these albums ?
Fixed: went through the gallery2 module admin:site config:Gallery settings:Install following above instructions and now sub-albums show gallery nav.

Thx again.

 
 

Drupal is a registered trademark of Dries Buytaert.