Fatal error: Cannot redeclare date_token_list() (previously declared in /home/.muckl/mysite.com/sites/all/modules/date/date/date.module:354) in /home/.muckl/mysite.com/sites/all/modules/token/token_cck.inc on line 226
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | token_cck.inc_.patch | 395 bytes | gengel |
| #2 | token.inc_.diff | 359 bytes | __Tango |
Comments
Comment #1
bomarmonk commentedI should add: I get this message when submitting a CCK node with date content, or when uploading an image to the same CCK content.
Comment #2
__Tango commentedI saw this tonight on my site running Date 5.x-2.x-dev along with token-5.x-1.10. It has to do with the interaction between these two modules.
In the token code, at the end of token/token_cck.inc, it has this code (at the end of the file):
and in the date/date/date.module code, it has this:
I'm not sure what the order of module loading is, but from this code, if the date code is loaded before the token code, you'll get this error. If the token code is loaded first, the error does not occur since the date module code will check to see if the function already exists.
I'm attaching a potential diff which merely puts a "if (!function_exists('date_token_list'))" to the token code. I'm not sure if this is the right way to go overall since i haven't delved too deeply into the token or date code. I'm moving this bug to the token project since the diff is for the token code.
Comment #3
__Tango commentedsetting code review flag
Comment #4
gengel commentedThe previous patch has too few parentheses. Use this one instead.
Comment #5
zzolo commentedI am seeing this too.
I have set up an node type with a date and a location/gmap. I get this error when trying to add a node of this type:
Fatal error: Cannot redeclare date_token_list() (previously declared in /drupal_5/sites/all/modules/date-5.x-2.0-rc/date/date/date.module:361) in /drupal_5/sites/all/modules/token-5.x-1.10/token/token_cck.inc on line 226
Thanks all for the great work as always.
--
Alan
Comment #6
gregglesI think this is already fixed based on the work in #206649: Update Date code in Token module for API changes in Date 2.x right?
See http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/token/token... which is pretty similar to what you propose.
So, upgrading to 5.x-1.x-dev should fix this. I'll mark/release a 5.x-1.11 if that version works for you folks.
Thanks for your help finding and fixing this bug. In general, if you find a bug, and especially if you are providing a patch, please do it against the latest version from the branch rather than an official snapshot release. That way you can be sure that you aren't redoing work that's already done.
Comment #7
gregglesAnd that...
Comment #8
CoolDreamZ commentedAlso noticed this when using the Workflow Module see here #238963: Cannot redeclare date_token_list()
Comment #9
geek-merlinupgrading to 5.x-1.x-dev solves this issue for me.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.