This occurred when I used the Minutes module to add to an Event (the new version with the date format changes).
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 33.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 34.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 35.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 36.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 37.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 38.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 39.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 40.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 41.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 42.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 43.
* warning: date() expects parameter 2 to be long, string given in C:\www\drupal\sites\sbs\modules\token\token_node.inc on line 44.
Comment | File | Size | Author |
---|---|---|---|
#24 | token_5_reroll.patch | 3.11 KB | mlncn |
#17 | token_5.patch | 3.48 KB | fago |
#9 | token_date_isset_0.patch | 3.54 KB | drewish |
#8 | token_node.inc__0.patch | 3.37 KB | ricflomag |
Comments
Comment #1
pukku CreditAttribution: pukku commentedFirst, I'm sorry I've taken so long to get back to you on this.
Second, I can't replicate this. It looks as though this may have something to do with token.module; do you have token.module enabled on your system?
Ricky
Comment #2
pukku CreditAttribution: pukku commentedAlso, did you apply the patch from jonathan_hunt to allow using path-auto with minutes?
Comment #3
NancyDruYes, token is installed and enabled. I did not know anything about a patch for pathauto; however, I do not have pathauto enabled (yet).
Comment #4
NancyDruI just looked at his patch, and it is inadequate for my needs. However, I have also been looking at the node auto title module, which I think will do what I need.
Comment #5
pukku CreditAttribution: pukku commentedHi! Actually, my question was more because I never call
date()
in my code, so I was wondering if his call todate()
might be causing the problem. I will have to download token.module and look at it to figure out what the problem is...Comment #6
ricflomag CreditAttribution: ricflomag commentedI have a fresh drupal install, with Token an Book modules enabled, but i don't use the Minute module. The same error as described by nancyw has occurred on creating my first book page.
I have moved this thread to the "Token" Module.
Comment #7
yan CreditAttribution: yan commentedI'm getting the same error message using upload path module which uses the token module. It first worked fine like twice but now I get the error message. Plus the data in upload path isn't right. I set it (using tokens) to [yyyy]/[mm] but it always puts 1970/01.
Comment #8
ricflomag CreditAttribution: ricflomag commentedHere is a patch against token_node.inc to avoid the warning.
Comment #9
drewish CreditAttribution: drewish commentedi'd reported a duplicate of this: http://drupal.org/node/166920 and used a different approach for fixing the bug.
Comment #10
gregglesApplied drewish's last patch to the DRUPAL-5--1 branch (modified slightly, his was for the HEAD version).
Thanks everyone.
Ready to be applied to the DRUPAL-6--1 branch.
Comment #11
David Stosik CreditAttribution: David Stosik commentedThe patch of post #9 doesn't work: I use token module with "Upload Path".
When I submit a node with attachment, the fields 'yyyy', 'yy', 'month', etc. of $values are not filled. Upload path then creates directories named [yyyy]/[mm]/[dd] instead of 2007/08/14 (date of node creation).
Solution suggested here seems better (and it works!).
Another problem of the same kind: when submitting a node, $values['nid'] is not set, as the node has not already a value. Thus, the folder [nid] I wanted to be created is not created.
Is this a token module concern, or does upload path use token module in a wrong manner?
Thanks,
David
Comment #12
gregglesIf $node->created is not set then something else is wrong.
I don't really like the idea of "if the values are empty, populate them with possibly incorrect data".
It could be that uploadpath will need to provide some tokens of it's own for this scenario, which is possible and reasonable.
Comment #13
gregglesComment #14
dennys CreditAttribution: dennys commentedI use upload path too, the patch of #9 doesn't work, but 134168 works.
Comment #15
fagoI just ran over the problem with a recent 5.x-1.x-dev version - so the problem isn't solved!
So I set the issue back to active..
$node->changed seems to be a non empty string, so the if doesn't apply. Of course this line fixed the warnings:
$node->changed = (int)$node->changed;
side-note: the indents are quite messy there
Comment #16
greggles@fago - perhaps you could provide a patch ;)
Comment #17
fagoof course ;)
Comment #18
scarer CreditAttribution: scarer commentedI can't get any of the patches to work. I'm excuting the patch command via ssh and they keep failing. Any suggestions? Sorry, I'm a bit new at this patch business...
Here's a copy of the .rej file log:
Comment #19
gregglesHow do I repeat this bug? I see "use minutes and add an event" but that seems short on real details.
Comment #20
drewish CreditAttribution: drewish commentedtry previewing a new node... i don't think they have to be events specifically, it just that $node->created isn't initialized
Comment #21
fagoI think I ran over it by using autonodetitle or worklfow-ng - of course a module needs to invoke token otherwise the error's won't appear.
Comment #22
gregglesGuys, I need _more_ details on how to repeat it, not less.
I'm using token with date values on plenty of sites but have never encountered this. So, what more do I need to do.
Comment #23
mlncn CreditAttribution: mlncn commentedBug confirmed when using module workflow-ng
Install workflow-ng.
Create a workflow like this one:
Also tried with a string comparison. I'm pretty sure that's what's helping trigger the error, the comparison that uses tokens. In my case I'm trying to compare the changed value of a CCK check box to the unchanged node version of the same CCK checkbox. No date invoked anywhere.
(I'm also replacing the title using node auto title to use the top [term] as the title but I don't think that's what's triggering it.)
Try to create and save a node of the type affected.
Comment #24
mlncn CreditAttribution: mlncn commentedRerolled the patch.
It applies and I can confirm that it fixes the problem. For those who wish to apply and test, put it in the token module directory and from within the token directory:
patch < token_5_reroll.patch
My workflow still doesn't do what I want it to, but I think that's my problem. No more token errors!
(I don't know why Fago's patch stopped applying, but I wonder if the use of tabs instead of spaces in token_node.module could be contributing to messiness?)
Comment #25
NancyDruI hope you've notified him of the tabs - they violate Drupal coding standards. The Coder module would have told him that if he had run it, as I do on all my modules.
Comment #26
gregglesI applied this concept to the 5.x-1.x branch.
@Benjamin - please be sure that you are creating patches against the tip of the DRUPAL-5 branch. Your patch didn't apply for me.
@nancyw - thanks for making sure that we know about the problem and about easy ways to check for them - I recently fixed those whitespace issues based on a patch provided by dmitrit01 - http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/token/token...
Comment #27
gregglesComment #28
gregglesPorted via eaton's work this past weekend.
Comment #29
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #30
davidwhthomas CreditAttribution: davidwhthomas commentedJust note for anyone experiencing this problem when using the Uploadpath module with the Token module and using date tokens. The fix passes the node->created timestamp, if not set so the token module handles it properly.
I fixed the issue with a patch to the uploadpath module.
For more information see here : http://drupal.org/node/152089#comment-623461
DT
Comment #31
susata CreditAttribution: susata commentedI see that the status of this is "closed" and assumed fixed; however, I am getting this error with Token (5.x-1.9) and Pathauto (5.x-2.0), both downloaded from drupal.org yesterday. The error message happens when I attempt to upload an audio file, and it looks like this:
warning: date() expects parameter 2 to be long, string given in /www/example.com/web/sites/all/modules/token/token_node.inc on line ##
example, of course, is our domain
## is different for each printing of the message, and there are MANY--it's a long list that fills the screen.
Is there anything I can do to stop this error from displaying? It looks like the audio file is actually uploaded okay, but the long list of warnings will be very disconcerting to users.
Thanks!
Comment #32
gregglessusata - are you also using upload path? If so, see the comment in #30. If not, please open a new issue so we can investigate your specific problem (follow up here with a link if you do that).
Comment #33
susata CreditAttribution: susata commentedNo--not using the Upload Path module or even the Upload module.
Here's the link to the new issue:
http://drupal.org/node/214036
Thank you,
s.
Comment #34
susata CreditAttribution: susata commentedUpdate: I have installed Upload (but not Upload path). I still get this same error - when I try to upload an audio file. I am posting this to the 'live' thread at http://drupal.org/node/214036.
s.
Comment #35
jcamfield CreditAttribution: jcamfield commentedI encountered this bug without Token installed; but (manually) applying this patch fixed it; http://drupal.org/node/141172
My problem was with event_views after upgrading to the event dev release. This was the thread that came up in my initial googling so I'm adding my comment here to help anyone else who stumbles across it.