call to undefined drupal_get_path_alias
kylehase - January 31, 2008 - 13:46
| Project: | Clickpath |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
When Drupal's performance page caching setting is enabled, the following error appears.
Fatal error: Call to undefined function drupal_get_path_alias() in /home/kylehase/public_html/modules/contrib/clickpath/clickpath.module on line 152
Error appears even when drupal's error reporting is set to "write errors to the log". This message does not appear when logged in as user 1.
Drupal v6 RC3

#1
strange - is anybody seeing this on d6.1?
#2
still seeing this myself
#3
confirm. Observed when in maintenance mode but not when logged in as user of admin group (all permissions enabled but differend to user/1!) -- nothing else tested.
#4
work-around for the time beeing: don't display when visitor not logged in:
.not-logged-in #block-clickpath-0{
display: none;
}
Maybe this has to do with caching the block or similar? Because I also noticed that
a) this error doesn't occure always
b) block in FF and Opera only refreshes if Strg+R pressed not by normal link navigation
Caching used here is normal (not agressive) but disabled for blocks.
Edit: Silly me, just not displaying the item, of course, wouldn't omit the error message... *dogh* So, this is not a work-around.
#5
Observed when page cache is normal, anonymous user, not in maintenance mode. Also got
Fatal error: Call to undefined function t() in /var/www/test/sites/all/modules/contrib/clickpath/clickpath.module on line 167a couple times.clickpath.module saves the path on hook_exit()
From http://api.drupal.org/api/function/hook_exit/6:
Before this the documentation says:
So, how about not saving the path on cached pages? Only save the path for authenticated users?
#6
#234790: seeing an error in was marked a duplicate of this
#7
Using hook_init() instead of hook_exit() is a fix but then the path is saved early and available in the SESSION for when the block is built. This means when you visit a page it is listed at the top of the recently visited pages which might not be acceptable.
Applies against DRUPAL-6--1 clickpath.module rev 1.1.2.1.2.2
#8
A huge downside of switching to hook_init() is the page title is saved before things like drupal_set_title() run. An example is taxonomy pages are listed in the module's block as "Taxonomy term" rather than the term name.
#9
Here's another approach, it only calls clickpath_save_path() when the user is authenticated.
#10
Subscribing (possibly see also related/duplicate #329002: undefined function t() -- fatal error).
#11
patch from #9 has been committed, expect a release soon.
#12
Automatically closed -- issue fixed for two weeks with no activity.