I'd tried out this module a few weeks before and everything worked fine. Now I reinstall the gallery 2 standalone and it works. However after uoploading your gallery2-module to embedd gallery into Drupal ... Drupal is down (before I can activate the module). No Content is shown (blank page, correct url, missing faveicon, no navigation is possible). I really don't know what's wrong. Is this a known problem? Is there any clue what I've done wrong?
I'm Using Gallery 2 1.2.0.6, Drupal 5.5., short urls ok, rewrite ok, gallery folder within the Drupal folder
Comments
Comment #1
JKDN commentedI had the same problem, but increasing the PHP Memory Limit in php.ini fixed the problem.
Can also be done with a .htaccess override.
Both methods shown here:
http://drupal.org/node/207036
Comment #2
miweb commentedThank you JKDN.
Unfortunately the changes don't solve my problem.
Comment #3
JKDN commentedWhat did you increase the memory limit to? I think I upped mine to 64MB which is excessive, but seemed to cover it. 16 Mb wasn't enough for all the modules/plugins I have installed in Drupal/Gallery2
If you make the change in php.ini, you may have to restart the webserer for it to take effect.
Comment #4
miweb commented128 MB. I wonder if memory really can be the reason for this problem.
Comment #5
matthewhelmke commentedI had the same issue (I presume...details from my site follow).
After the module upgrade, all requests for any page on my site from a person not logged in received the following error:
Fatal error: Call to undefined function drupal_get_path() in /path/edited/for/this/site/gallery.module on line 4I 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.
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.
I have a blog post on the issue, so it is possible that more comments from users not registered here may appear there. If you are interested, look at http://matthewhelmke.net/index.php/2008/02/23/38-drupal-gallery2-integra...
Comment #6
TomChiverton commentedI see this too, all my RSS feeds were broke until I changed the top of gallery.module to say
if (function_exists('drupal_get_path')){
require_once(drupal_get_path('module', 'gallery') .'/gallery_base.inc');
}
This at least lets the feeds run, but I'm sure has nothing to do with the real problem.
Comment #7
profix898 commentedThanks for nice description of the problem, matthewhelmke! I was able to reproduce the problem on all my dev installs. A similar issue was posted in http://drupal.org/node/223343 (marked that one duplicate).
Changing issue details to "critical bug". I will try to fix the problem asap.
Comment #8
profix898 commentedCan anyone confirm that wrapping that line in "function_exists(..." fixes the problem? A recent change to the module, namely the introduction of hook_exit() , causes small parts of the module to be loaded even for cached pages (where various core functions are not available). From what I understand the modification as mentioned in #6 should fix the issue.
Comment #9
hquadrat commentedHello profix898,
I had absolutely the same issue on my site (www.hquadr.at), the error just appeared for unregistered users so that it was in fact impossible to visit my site as an unregistered user / not logged in user.
For me comment #6's solution from TomChiverton solved the problem - i just hope there are no other side effects to come.
hQuadrat
Comment #10
rkdesantos commentedAfter making the change noted in #6,
I am still getting the gallery_init errors in the log: "Unable to initialize embedded Gallery. You need to configure your embedded Gallery.
Error (ERROR_PERMISSION_DENIED) : Invalid return URL!" as noted in the other thread: http://drupal.org/node/223343
Anonymous users are (apparently) getting in, but we see these new errors in the logs:
Update: clearing the cache using phpmyadmin fixed this error...
Will be monitoring to see if anonymous users start getting rejected again.
Comment #11
dennys commentedI have this problem too and it still doesn't work even I change the memory to 128MB. And it's ok when I disabled the cache function.
Comment #12
matthewhelmke commentedEnabling the test shown in post #6 has made it possible for my site to work, with Drupal's performance caching enabled. I'm glad to have a working hack, but will be even happier when you have had time to discover the reason why drupal_get_path() isn't being found when users are not logged in. That is odd. :)
Thanks for working on this! I appreciate your efforts and your plugin very much.
Comment #13
profix898 commentedThis is not about users being logged in exactly, but about the page cache and only anonymous users are served from the page cache directly. For logged in users the pages are generated on every request (otherwise personal settings, etc. could not be taken into account). The program flow for cached pages however never loads all of Drupal's core includes (usually DRUPAL_BOOTSTRAP_FULL - the last phase - loads the common.inc stuff). It only loads the cache-related subsystem (everything up to DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE), fetches the ready-rendered page from cache and serves it to the user. Thats the simple reason why drupal_get_path() and everything from common.inc is not available for cached pages.
Comment #14
dfgfdgdfgdfg commentedI've the same error: "Fatal error: Call to undefined function drupal_get_path() in /var/www/vhosts/thecoccinella.org/httpdocs/modules/gallery/gallery.module on line 4". Disabling the cache fixed the issue, but I hope this bug is fixed soon so that I can enable the cache again before I get problems with it. This bug was nonexistant in the previous version of the Gallery module.
Comment #15
profix898 commentedI have just committed a patch to fix this issue. Can anyone (or better some of you) please get the latest version and comment back? If it is working for you as expected I will tag a bugfix release asap. Thx.
Comment #16
dfgfdgdfgdfg commentedSeems to work on my install (coccinella.im and thecoccinella.org).
Comment #17
profix898 commentedThanks dfgfdgdfgdfg. Anyone else? I'd like to get at least 2 positive comments ... to be sure that it is really fixed.
Comment #18
inforeto commentedwhich one is the fixed version 5.x-2.1 or dev?
Comment #19
rkdesantos commentedI have the fix in #6 installed and it seems to be fine so far; but assuming the patched version is dev, is there any reason we should be cautions about moving to the dev version at this point (beyond the usual proviso about dev versions in general), e.g does it have any known incompatibilities with anything else, is it only compatible with certain versions of Gallery (e.g. a dev version of Gallery), etc.? I've read the notes and didn't anything that looked like a concern.
Comment #20
profix898 commented-dev only contains the patch for this issue extra compared to the 2.2 release. Otherwise its identical. And because this is a critical bug, I will tag a 2.2 release if you can confirm that the latest version works correctly.
The 5.x-2.x series is in maintenance stage and development shifted to the 6.x-1.x branch instead. No need to fear unstable code in the latest 5er branch.
Comment #21
inforeto commentedMoved to dev version to solve this issue and it worked.
I think was introduced with the 5.x-2.1 version, which i upgraded from 5.x-2.0 this same morning.
Now i was left with a broken gallery_menu.module but that might be another issue.
(an 'Error fetching album tree' like in http://drupal.org/node/181703)
It was marked fixed so please check if the patch or the issue have reintroduced this other issue.
(because that one also deal with anonymous users and init functions, which i gather was in play here)
Edit: using gallery 2.2.2.
Comment #22
matthewhelmke commentedOkay. That makes sense. Thank you for the clear explanation. I appreciate it.
I switched my site to 5.x-2.x-dev and it seems to be working well. Thanks again!
Comment #23
mlissner commentedWow. That was quite confusing and frustrating. I was doing so much work to the site getting it ready for 6.0 I figured this was my fault and tried a bunch of things to fix it myself...little did I know....
Comment #24
trochevs commentedHi Everybody,
The Gallery module 5.x-2.x-dev (release date: 2008-02-25) worked for me and the problem is gone. No other problems are observed at this moment.
Thank you for quick update,
SAL-e
Comment #25
miweb commentedThank you very much. It seems to work fine :-)
As I worked on my drupal site last days I've found out my own mistake. My hoster has copied my database to a server with a different root. The drupal cache unfortunately has been shown the path to the old root. So the error occured. I schould have looked for that. ;-(
Comment #26
miweb commentedSorry for duplicate postings :-(
Comment #27
miweb commentedSorry again :-(
Comment #28
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.