PHP Fatal error: Call to undefined function token_get_values() in modules/pathauto/pathauto.inc on line 315

mfb - August 30, 2007 - 00:06
Project:Conference Organizing Install Profile
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

When initially installing pathauto via a drupal install profile, I had a PHP Fatal error: Call to undefined function token_get_values() in modules/pathauto/pathauto.inc on line 315. I'm not sure if the attached patch is the "correct" way to fix it, but it does work.

AttachmentSize
pathauto.token_.patch671 bytes

#1

xav - August 30, 2007 - 20:22
Priority:normal» critical

Not sufficient here. The error is now in pathauto_user.inc, and apparently there's an untold dependency with the "token" module ...

#2

greggles - September 2, 2007 - 11:52

@mfb - which version of token are you using? 5.x-1.8 or 5.x-1.x-dev shouldn't have this problem. Was it anything else aside from just installing it? I think the problem you face may only affect the installation profile situation and not necessarily the normal use, is that right?

@xav - please define "untold" because the dependencies is documented 1) on the pathauto project page for months now and also more directly in the pathauto.info file since april 27th.

#3

mfb - September 2, 2007 - 17:51

I am using token module current DRUPAL-5 branch.
Install profile is a "normal" usage, in my opinion, given the many profiles using pathauto: drupal wiki, bryght basic, etc.

I haven't looked into this enough to know where the bug lies, pathauto or token module?

#4

greggles - September 2, 2007 - 18:14

But you have to agree that the installation process is more of a corner case than every day operation of the site.

Perhaps I am just confused - Does the problem only occur during the installation or is it all the time (e.g. during node creation after the profile has been installed)?

#5

mfb - September 3, 2007 - 21:58
Status:patch (code needs review)» fixed

This now seems to be fixed in the current DRUPAL-5--2 branch.

#6

Anonymous - September 17, 2007 - 22:01
Status:fixed» closed

#7

jackbravo - November 7, 2007 - 17:23

Hi. I'm using pathautho-2.0 and this doesn't seem to be fixed. I tried with current drupal 5.3 and with latest drupal branch DRUPAL-5 from CVS. I get the same error just on a different line:

Fatal error: Call to undefined function token_get_values() in /var/www/conference/web/profiles/cod/modules/pathauto/pathauto.inc on line 354

I'm also using an installation profile. The Conference Organizing Profile. Should I open a new bug?

#8

jackbravo - November 7, 2007 - 18:22

For me, the problem occurs only during installation (it doesn't let me continue after that).

#9

greggles - November 7, 2007 - 18:44
Status:closed» active

Good points.

I will test this out and see if i can find a fix.

#10

greggles - November 7, 2007 - 19:40

@jackbravo - I think this is actually a bug with cod. They need to add "token" as a requirement and then also add it into cod_profile_modules()

Can you test out if that fixes the problem? thanks.

#11

jackbravo - November 7, 2007 - 19:42

If I can help with anything just let me know. I know PHP although but I'm not familiar with drupal internals.

#12

greggles - November 7, 2007 - 19:52

my comment in #10 proposes a solution - can you edit the .profile file and include the token module in your sites/all/modules and see if that fixes it?

#13

jackbravo - November 7, 2007 - 22:18

@greggles - Sorry, didn't see your #10 comment.

I did what you say, adding 'token' to the array on cod.profile.
And I guess it fixed that problem. But now it fails with this error:

Fatal error: Call to undefined function token_include() in /var/www/conference/web/profiles/cod/modules/token/token.module on line 32

also during the profile installation.

#14

greggles - November 16, 2007 - 22:34
Project:Pathauto» Conference Organizing Install Profile
Version:5.x-2.x-dev» 5.x-1.x-dev
Priority:critical» normal

Eaton just committed a fix for http://drupal.org/node/186889 which should alleviate the problem that JackBravo mentioned in comment #13.

So, this should be an issue against whichever profiles don't currently require both pathauto and token (I'm looking at you COD, since JackBravo mentioned it by name). If you use another profile affected by this then lodge an issue for that profile.

#15

greggles - December 10, 2007 - 17:19
Status:active» fixed

Looking through the COD issue queue I guess that this has been fixed in various other issues and/or is a duplicate of http://drupal.org/node/182226

#16

Anonymous - December 24, 2007 - 17:21
Status:fixed» closed

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

#17

greggles - February 13, 2008 - 13:37
Status:closed» fixed

So, I'm still not sure how to repeat this bug, but I think it's worth protecting against a bit more.

I wrapped this call in a check for whether the function exists. If not, it just returns an array which will create an ugly alias but hopefully won't create a WSOD.

So, back to "fixed" again.

#18

Anonymous (not verified) - February 27, 2008 - 13:42
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.