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.
Hi all,
When i am upgrading token module from "7.x-1.0-beta4" to "7.x-1.3", got an error
"Fatal error: Cannot redeclare token_replace() (previously declared in /drupal7/includes/token.inc:79) in /drupal7g/sites/all/modules/token/token.module on line 216".
Please give me suggestions.
Comments
Comment #1
saiprasad kandavalli CreditAttribution: saiprasad kandavalli commentedPlease reply me asap
Comment #2
saiprasad kandavalli CreditAttribution: saiprasad kandavalli commentedfixed.
Comment #3
ronline CreditAttribution: ronline commentedHI saiprasad.
I am having the same prob during the upgrade from d6 to d7.
Could you please post what was the soultion for your case ?
Thx
Comment #4
saiprasad kandavalli CreditAttribution: saiprasad kandavalli commentedHi ronline,
its fixed on next version of token module (7.x-1.4)
Comment #5
EffortlessHR CreditAttribution: EffortlessHR commentedThanks devs for the prompt fix.
Comment #6
Dave ReidFunny, I nothing changed with token_replace() because it's provided by Drupal core and not Token module. You must have had some outdated code, or something duplicate somewhere. I didn't fix anything.
Comment #7
ronline CreditAttribution: ronline commentedIssue still there.
[Sat Mar 02 16:16:14 2013] [error] [client 192.168.1.12] PHP Fatal error: Cannot redeclare token_replace() (previously declared in /var/www/ronline/www/includes/token.inc:79) in /var/www/ronline/www/sites/all/modules/token/token.module on line 216
Isn’t it related to including token in D7 core?
We can see that the function is firstly being declared in www/includes/token.inc and then it clashes with sites/all/modules/token/token.module.
Comment #8
Dave ReidYou must be using the Drupal 6 version of the module with Drupal 7 core, which of course will cause lots of problems.
Comment #9
Dave ReidComment #11
dkl4 CreditAttribution: dkl4 commentedI ran into this during a D6 to D7 upgrade. It was kind of an "order of operation" error.
I was upgrading modules one-by-one, and I still had a D6 version of token hanging around when I upgraded to the D7 version of pathauto (which requires D7 version of token).
Deleting the old D6 version of token first removed the error.