Closed (fixed)
Project:
Token
Version:
5.x-1.x-dev
Component:
Documentation
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 Jan 2008 at 16:13 UTC
Updated:
12 May 2008 at 15:42 UTC
Jump to comment: Most recent file
Comments
Comment #1
lias commentedI've decided to go back to dec. 28 version. Thanks.
Comment #2
jaydub commentedI get a fatal error of 'Call to undefined function date_show_date() in /opt/www/drupal-5.2.int.thatsbj.com/sites/all/modules/token/token_cck.inc on line 264'
pretty much the same error as the above post. I presume that there are new replacement functions for date_show_date (and date_fuzzy_stamp) that could be used to patch up token_cck? I'd like to continue testing the new Date module.
Comment #3
karens commentedI didn't realize the token module had date code in it. The Date API has changed so that will need to be fixed. When I get a chance I can try to figure out what patch is needed for the token module, but I can't do it right now.
If you're interested, maybe you can figure out a patch?
Comment #4
jaydub commentedWell token_cck calls both date_make_date and date_show_date. The first function from the date module still exists in HEAD but the second function date_show_date does not. Also it seems that the parameters for date_make_date and date_format_date have changed in HEAD.
The code block in token_cck contains the following where $item would be a date CCK field:
So with the new date API what would be the equivalent call for date_make_date to create the date object? I figure that's probably the more important change. Then replacing date_show_date would presumably be accomplished via another new or renamed date API function.
Is there an API changelist somewhere that would detail how to use the new API to port old code?
Comment #5
karens commentedSince the code needed is different depending on what version of the Date module you're using, what we probably ought to do is move that code into the Date module so it will have the code that matches the version.
Basically the new code would be (doing this from memory, so hope I have it right):
Comment #6
karens commentedRenaming this issue so it's easier to find. The best solution is probably going to be moving the token module code from Token to Date, then we can have the right code for the right date version.
Anyone up for making a patch for both Date and Token to get that done?
Comment #7
markfoodyburton commentedIf you have the token module installed, very bad things happen when you try to do an update (as in site update) of date
Comment #8
marcoBauli commentedi'm getting a similar error with Token and Date as soon as i preview or submit any node:
setting this to critical as basically is impossible to insert date content in a site. thanks
Comment #9
marcoBauli commentedok, updated token_cck.inc with new values from KarenS at #5, but seems there are other rows to update right below those ones:
tryed to have a look at date.module, but things looked bit harsh for a non-programmer.. :P
PS: also seems that token.inc is still looking for /date/date.inc (line 252) so it throws some other 'include' errors.
Comment #10
dreed47 commentedThis is critical for people trying to get this module to work. Creating patches to get this to work is all fine but can someone save us all a bunch of time and at least tell us what version of the date module is compatible with what version of the token module?
Comment #11
steve hanson commentedThe version 2 branch of Date is incompatible with token.
Comment #12
anthonym commentedsubscribing
Comment #13
RdN commentedThis worked for me.
Search and replacing date_show_date() with date_format_date() and removing with the date module enabled, of course.
Shouldn't the token module require the date API module through a "dependencies" entry in token.info and not include it in this way?
Hope this is of help.
Comment #14
artis commentedHere is my code for token_cck.inc lines 252-303.
This seems to be working for me. It's a little bit of a combination of all the comments above. I don't get any error messages on View, Edit, or Submit.
Hopefully someone can create a patch of this. I really need to learn how to do that! :-)
Artis
Comment #15
neochief commentedHere the patch based on artis' code
Comment #16
karens commentedNote that this is a patch for the Token module, not the Date module. It doesn't do any good to post it here, it needs to be posted in the Token module issue queue, so moving it there.
Comment #17
artis commentedChanges Title to be more descriptive. Changing version to the version code was applied to.
In other words don't apply this patch unless you are using Date Module 5.x-2.x
Comment #18
greggles@karens - I agree that in order for this to work properly regardless of the date module version that people are using the token code needs to be moved to date module.
For anyone who wants to make a full patch:
1) It should move this code _out_ of token module and into date module
2) It will require 2 patches for date module - 1 for the old style of date formatters and 1 for the new
3) It will remove the token code related to date module
I'm tempted to just remove this from token and let you folks handle it in Date separately - thoughts? At least that way we wouldn't have problems with non existent functions...
Comment #19
karens commentedI was waiting to hear if you preferred a patch in Token or moving it to Date. I think I have enough info now to figure out the right patches to make in Date if you tell me when you're making the change in the Token module so we can do it at the same time.
Comment #20
gregglesI've got a patch here which I have applied to the 5.x branch and the 6.x branch. It will check to see if the date_token_list function already exists before declaring it which will help during the migration period. Sound good?
Reassigning to date queue for the remainder of the work. Once you've fixed this there and done an "official release" so that we think people are upgraded to the version where date contains the tokens then we can _really_ remove it and do a new release of token.
Comment #21
karens commentedWe may still end up with a race condition, so I wrapped the new functions in the Date module in a check for function_exists(), too. Committed to 5.1, 5.2, and 6.x.
Comment #22
gregglesAgreed - thanks for fixing this.
Comment #23
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #24
geek-merlinSo can someone clarify which versions of the modules work together and which do not?
I' a bit confused. Thank you!
Comment #25
geek-merlinUps, Title should stay.
Comment #26
gregglesI can´t say which versions of date that you will need. I believe you will need a 5.x-1.x-dev version of token, though. When it does get rolled into an official release it will be 5.x-1.11 of token.
Comment #27
karens commentedYou need the latest version of Token that has the fixes to the date code, see #26.
Comment #28
karens commentedMarking this active again to suggest getting this change into an official release. I keep getting issues about this (and I see more of them in the Token queue) so it's probably time to get this into an official release.
Comment #29
karens commentedOops, I re-activate a Date issue and I need to get this into the Token module.
Comment #30
gregglesI just create a 5.x-1.11 release so this shouldn't be a problem any more.
Thanks, KarenS.
Comment #31
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.