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
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | clickpath_hook_exit_auth-216308-9.patch | 669 bytes | coltrane |
| #7 | clickpath-user-hook_init-216308.patch | 703 bytes | coltrane |
Comments
Comment #1
zilla commentedstrange - is anybody seeing this on d6.1?
Comment #2
zilla commentedstill seeing this myself
Comment #3
thomas23@drupal.org commentedconfirm. 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.
Comment #4
thomas23@drupal.org commentedwork-around for the time beeing: don't display when visitor not logged in:
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.
Comment #5
coltraneObserved 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?
Comment #6
coltrane#234790: seeing an error in was marked a duplicate of this
Comment #7
coltraneUsing 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
Comment #8
coltraneA 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.
Comment #9
coltraneHere's another approach, it only calls clickpath_save_path() when the user is authenticated.
Comment #10
vacilando commentedSubscribing (possibly see also related/duplicate #329002: undefined function t() -- fatal error).
Comment #11
coltranepatch from #9 has been committed, expect a release soon.