Closed (fixed)
Project:
Week Field
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Jun 2006 at 02:20 UTC
Updated:
30 Jun 2006 at 02:21 UTC
Jump to comment: Most recent file
I'm running PHP 5.1.4. I'm getting this constantly in the Drupal 4.7.2 logs:
mktime() expects parameter 4 to be long, string given in /modules/week/week.module on line 123.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | week_php5.patch | 605 bytes | Prometheus6 |
Comments
Comment #1
Prometheus6 commentedDo you know how to patch files?
I'm running the same php version on my production sites now and I'm not getting such a message. On the other hand, if I were I'd just typecast the variables, which would do no harm.
I'd rather not fix what I don't see as broken, but I'm willing to give you a patch. If you don't have patching skills, look for line 152
$query = _weekly_contentQuery(arg(1), arg(2), arg(3), $week_rev_pagesort);
...and replace it with this.
$query = _weekly_contentQuery((int) arg(1), (int) arg(2), (int) arg(3), $week_rev_pagesort);
If it all goes well, I'll update the distribution.
Comment #2
slimandslam commentedI have skills. I don't understand your fix, though. The error seems to say that you're passing a string as argument #4, but it expects a long int. So why are you casting arguments 1,2, and 3 as ints??
Comment #3
Prometheus6 commentedThe actual error (which, again, I don't see the error) occurs inside _weekly_contentQuery().
There are two calls to mktime(). If you look, you'll see the first call passes strings to parameter 4 AND 5 AND 6. The second call, where the error occured, passes strings to parameter 4 and 6.
To build the query that populates the block I'm pulling in arguments from the URL. Those default to strings. PHP4 didn't care...PHP5 does (which, incidentally, I think is a very good thing, and I've shifted my development environment over to PHP5 so this sort of thing will stop eventually).
So I'm casting the strings as integers when I pass them into _weekly_contentQuery(). This is something that should address your problem without impacting anything or anyone else.
Comment #4
jw867 commentedI had the same problem, but the casting resolved it. I would commit the patch.
Comment #5
Prometheus6 commentedOkay, I just needed a tiebreaker.
Comment #6
slimandslam commentedOk. I see your point. Thanks.
Comment #7
Prometheus6 commented