We're using securesite.module and ldap_integration/ldapauth.module for authentication on our site. When a user logs in, they get the following error:

Fatal error: Call to undefined function token_get_values() in /home/qasap/www/blogs/sites/all/modules/pathauto/pathauto.inc on line 339

This occurs because ldapauth.module does a user_save with every login. user_save calls pathauto_user, which calls some token functions.

This is really an initialization problem. Securesite does authentication in securesite_init, which occurs before token_init, meaning token.inc hasn't been included and token_get_values isn't defined. Changing token.module's weight to -1 fixes this issue.

Comments

junyor’s picture

Note that disabling securesite.module will also solve this issue.

greggles’s picture

possible solutions:

1) set token module's weight to -1
2) refactor token.module and token.inc to move all of the token.inc functions into token.module token.inc isn't that big to make this a big improvement anyway

mgifford’s picture

I ran into this problem.. had to disable then enable the pathauto modules and then all worked fine. This was after an upgrade of the latest version of pathauto after the security release.

Think there are some other strange things that have been introduced by Pathauto 5.x-2.0.. Maybe it's just a config stuff that's changed though. Will have to look at that in greater depth.

eaton’s picture

Status: Active » Needs review

Most of these problems appear to originate with the split between token.module and token.inc -- there are certain scenarios in which token.inc never gets included, and all hell breaks loose.

Greggles and I chatted about the issue and came to the conclusion that it makes sense to roll the .inc file in with the .module file, since there are no situations in which we DON'T want the .inc file's functions to be available. No release has been rolled yet, but the dev build of token should have the fix -- if you can take it for a spin, and see if it fixes the problem, that would rock. Thanks!

junyor’s picture

Status: Needs review » Reviewed & tested by the community

Yes, that takes care of it!

greggles’s picture

Status: Reviewed & tested by the community » Fixed

Cool.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.