Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
securesite fails to allow access to some URLs because a call to drupal_get_path_alias
fails with "Call to undefined function" i n line 346.
I believe this is because drupal_get_path_alias
is defined in includes/path.inc but this file is not included during bootstrap for cached pages. Since the client connection is anonymous and is attempting access specifically provided by securesite, it makes sense the URL / page will usually be in cache, and this is will fail most of the time.
From a quick look at the CVS commit messages, it appears this may be a recent addition to the code.
Comments
Comment #1
Chris Johnson CreditAttribution: Chris Johnson commentedIt appears the problem is more complicated than I had first thought -- and thus, it is unlikely that a recent CVS commit to securesite is the cause.
As a test, I fixed the problem with the missing includes/path.inc functions. I got new errors about missing functions from includes/common.inc. Fixing that gave me new errors for missing functions in includes/theme.inc.
Clearly the problem is that the system has not bootstrapped any of these pieces, but rather only the bare minimum in includes/bootstrap.inc for cached pages. I'm not sure what this means. On the one hand, it makes sense that something which is trying to authenticate anonymous users, which is what securesite is all about, would have cached pages. On the other hand, this module apparently works for most people using it, so they are not encountering this problem.
I will continue to research and report any useful findings.
Comment #2
Chris Johnson CreditAttribution: Chris Johnson commentedThis seems to be some sort of interaction with the opensearch module, which provides an XML search result feed for client aggregators.
Comment #3
NaX CreditAttribution: NaX commentedDo you still get error messages if you disable the opensearch module. If you do still get errors, are they different.
Comment #4
Chris Johnson CreditAttribution: Chris Johnson commentedUpdated to latest 4.7 release version (securesite.module v1.2.2.24), disabled opensearch and most everything else, and hit home page. I got this:
Comment #5
Titus98usn CreditAttribution: Titus98usn commentedI'm using secure site 5.x-1.0 with Drupal 5.1 & I'm getting the following error on my main page using IE:
Fatal error: Call to undefined function: drupal_lookup_path() in /my/drupal/path/modules/securesite/securesite.module on line 387
Comment #6
anders.fajerson CreditAttribution: anders.fajerson commentedI got the mentioned error "Fatal error: Call to undefined function drupal_lookup_path() in securesite.module on line 387" when I added a page in the "Bypass Login Filter Pages"-box and then tried to access the page. Is that what you others to do initiate this error?
Googling on it I found a comment from chx at http://drupal.org/node/46291. Adding
drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH);
belowfunction securesite_check_path()
removed the error message and let me access the page. No idea if that is the right way to do it though.Comment #7
FiReaNGeL CreditAttribution: FiReaNGeL commentedI get Fatal error: Call to undefined function drupal_get_normal_path() in D:\wamp\www\zscience\modules\quickstats\quickstats.module on line 23
on a custom module I build on cached pages, so I dont think its a problem related to Secure Site; it must be drupal related; not loading the appropriate libraries on cached pages?
Comment #8
NaX CreditAttribution: NaX commentedTry this; add the following to line 385 in the securesite.module file.
Comment #9
FiReaNGeL CreditAttribution: FiReaNGeL commentedNax suggestion fixed the problem for my custom module; I'm sure it'll for securesite too.
Comment #10
Steven CreditAttribution: Steven commentedTested locally and verified it. With caching enabled, the listed code is required to make the path lookup work.
Since I've been doing some recent code cleanup, and NaX proposed the change, I went ahead and committed it to 4.7 and 5.
Comment #11
(not verified) CreditAttribution: commentedComment #12
jswap CreditAttribution: jswap commentedI am seeing the bug periodically in Drupal v5.7. It seems to only happen when I make a request for a page other than the front page, after having not visited the site in several hours. The error message is:
"Fatal error: Call to undefined function drupal_get_path_alias() in /usr/local/drupal-5.7/includes/common.inc on line 1193"
This particular error was caused by a request for a blog page (//?q=blog).
Comment #13
drummjswap - if you are using the securesite module, see above, it has been fixed for almost a year.
If this is another problem, then open a separate issue. There is a good chance you have a contributed module implementing hook_init() which uses the path system.