Drupal, Gallery2 integration, and a recent module update
February 23rd, 2008
I have another website that runs Drupal, with Gallery2 embedded. Yesterday I upgraded the Drupal module which does this. I had problems.
Suddenly, my site was unavailable for anyone who was not logged in. Everyone attempting to access the site received this message:
Fatal error: Call to undefined function drupal_get_path() in /path/edited/for/this/blog/gallery.module on line 4
Hmm. That’s not good. I read through all the sources for each updated file and nothing looked out of place. I was quite confused as to why this was happening. On a hunch, I disabled the Drupal caching mechanism for the site by browsing as the site admin, user #1, to admin/settings/performance and completely disabled the cache. This is a relatively low traffic site anyway, so it shouldn’t make any difference. That fixed the problem, at least as far as I can tell. The site appears to be accessible from multiple computers in varied locations, so I think we are good.
Hopefully this will help someone else out there who is having the same issue with this module update. If not, it will at least help me remember what I did. ![]()
Entry Filed under: General













9 Comments Add your own
1. matthew | February 23rd, 2008 at 8:59 am
Something to add… Re-enabling the cache causes the error to reappear, so this is repeatable. I am currently unable to use caching on the site in question. Again, that site has very little traffic, so it isn’t a big deal, but for large traffic sites, the problem could remain.
2. matthew | February 23rd, 2008 at 9:16 am
I have commented on an existing bug, that I believe is identical, on the drupal.org site at drupal.org/node/224598#co… .
3. Andrew Zajac | February 23rd, 2008 at 1:00 pm
Have you tried clearing the cache?
4. matthew | February 23rd, 2008 at 1:10 pm
Hi Andrew.
If you mean the local browser cache, yes.
If you mean the Drupal cache on the server, I have only done what I described in in the post and comment #1. Is there something further I can attempt?
5. Andrew Zajac | February 23rd, 2008 at 7:05 pm
You can run:
DELETE FROM cache;
Or simply empty the tables by hand from phpmyadmin. I have had to clear the views cache like that, too.
6. matthew | February 23rd, 2008 at 7:32 pm
Okay, I get what you mean. I cleared the cache tables in the database and it had no effect on the issue. I still get the error if the Drupal performance caching is turned on, and the error disappears if the feature is turned off.
That was a good idea to try though. Thank you.
7. hQuadrat | February 23rd, 2008 at 8:28 pm
Hi there,
had the exactly same issue with the gallery.module v. 5.x-2.1.
Look back at the thread you had commented on, comment #6:
drupal.org/node/224598#co…
You just have to add two lines to gallery.module and it should be working again.
Greets, hQuadrat
8. matthew | February 24th, 2008 at 3:29 am
hQuadrat: thank you for pointing to that solution. It seems to have taken care of the problem on my site.
For everyone else, the solution for the moment is to change the top line of gallery.module to read
if (function_exists('drupal_get_path')){require_once(drupal_get_path(’module’, ‘gallery’) .’/gallery_base.inc’);
}
This test is a good workaround that allows the site to work with the performance cache enabled. It’s not a perfect solution, as we still get errors in the site log. I know the devs are working on the issue and hopefully they will be able to get a better solution written in to a new release shortly.
9. matthew | February 25th, 2008 at 6:28 pm
The latest 5.x-2.x-dev version of the gallery module fixes the problem. A new "stable" release is expected shortly.
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed