problem with normal mode caching (not just aggressive mode)
| Project: | Global Redirect |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
As the performance settings page says,
"The normal cache mode is suitable for most sites and does not cause any side effects. The aggressive cache mode causes Drupal to skip the loading (init) and unloading (exit) of enabled modules when serving a cached page. This results in an additional performance boost but can cause unwanted side effects.
The following enabled modules are incompatible with aggressive mode caching and might not function properly: ..., globalredirect, ..."
Therefore, I am only using normal caching, yet I am still getting an error report from my globalredirect (even though I am not using aggressive mode caching)
As Anonymous, when I reload a page that was just cached in my cache_page table, I still get "Fatal error: Call to undefined function drupal_query_string_encode() in /modules/globalredirect/globalredirect.module on line 22"
I am assuming this is the same type of error I would get using aggressive mode. Does anyone else have issues with the normal mode caching like this? Or any suggestions?

#1
#2
I can't replicate this and I use GR on a LOT of sites with normal caching... What else is running on your site? Are you using any alternative caching modules/tweaks? Which version of Drupal5 you using?
#3
Can you list all the modules you have enabled (and their versions)?
Can you provide the theme you're using and maybe anything unusual in your template.php?
The odd thing is - that function is in common.inc which gets included when a page isn't cached. Now if you access a page on, say, node/1 then it is not cached and you get redirected - I believe the page will not enter the cache as a redirect is in place. Say you get redirected to an article of some kind. Then we hit the _drupal_cache_init
CACHE_NORMAL(ie non-aggressive) then the init hooks ARE fired... BUT because at this pointpath.incis not included (we're atDRUPAL_BOOTSTRAP_LATE_PAGE_CACHE) then the functiondrupal_get_path_aliasis not present. Because its not present, the GR init function does not fully execute and therefore the problem you're experiencing wont occur.Therefore, logically, you're setup is doing something very different. You must have a module which, during its own
hook_initis includingpath.incand then later the init function for GR is getting invoked but there is a missing include.#4
Can you try out Global Redirect 1.3 please?
#5
1.3 seems to have possibly resolved the specific initial issue (I hadn't tested this prior to the 1.3 upgrade since I orginally posted this issue in January, though), but I now see the following:
Fatal error: Call to undefined function _menu_item_is_accessible() in /modules/globalredirect/globalredirect.module on line 36
It is possible this is an issue with another module; we currently use many modules (probably too many to list), including
Ad 5.x-1.5,
Node Queue 5.x-2.0,
Path Redirect 5.x-1.2,
LoginToboggan 5.x-1.2,
Referer Tools,
singlesignon 5.x-1.x-dev (which required a patch to work with normal mode caching),
javascript aggregator 5.x-1.3,
nice menus 5.x-1.2 (you were saying something in a previous comment about another module possibly including path.inc; maybe nice menus has this conflict with the menu.inc, where this specific function is defined - ? - I don't know that i fully understand your explanation of a situation like that; I tested with disabling the nice menus module, though, and still received this error)
Do you have any more suggestions we could test out?
#6
Do you only see this message on logout or do you see it on all pages? If just logout then this is a dupe issue of #280061: Call to undefined function _menu_item_is_accessible() when logging out
#7
I am getting this issue with any Anonymous page that has already been cached. (not just logout) - I switched to garland theme, just to make sure it wasn't the theme, and am still getting the error.
We do have javascript in the footer now instead of the header.
We also have Advanced Cache, Taxonomy Access Control Lite, URLify, Pathauto,... - but I tried disabling these modules and still had the error message.
#8
Javascript location wont be causing this... This is VERY strange!
#9
I'm getting this as well, normal caching, on all cached pages for anon users. Modules I'm running that implement hook_init are: content, devel, imagecache, logintoboggan, nodequeue, quickstats, globalredirect. I'm running GR 1.3-1.
I've added a function_exists check for _menu_item_is_accessable before the call to that function, and it seems to have fixed the fatal error, leaving redirects working. See attached patch.
#10
This seems to have helped. We can finally use normal mode caching - thanks, tomchuk!
#11
Looks like a good patch to me... +1
#12
Committed to latest DEV release - will appear in next official release...
http://drupal.org/cvs?commit=130598
#13
Automatically closed -- issue fixed for two weeks with no activity.