I realized a while back that my cron job wasn't running at all. I tried to set up a server cron job and that won't run either (cPanel) So I tried running it manually by entering the url cmtravelathome.com/cron.php this works except I get this error every time:

warning: gmmktime() expects parameter 3 to be long, string given in /home/cmtrav/public_html/modules/aggregator/aggregator.module on line 785

I have looked all over drupal.org and can't seem to find any information on fixing this error - I am hoping that if I can get this error fixed then this will fix the problem with the cron job not running as well.

I welcome any suggestions however, I'm not really a programmer so please be specific in any troubleshooting instructions.

Thanks!
Judi

CommentFileSizeAuthor
#3 aggregator_module.patch1.08 KBvladimir.dolgopolov

Comments

drumm’s picture

Version: 5.0 » 6.x-dev
Priority: Critical » Normal

$seconds needs to be set to 0 instead of NULL when it is not included in the timestamp.

vladimir.dolgopolov’s picture

My suggest is to use some kind of check before send values to gmmktime() as the W3C date/time format is not very strict:

Like this:

if (empty($hours)) $hours = 0;
if (empty($seconds)) $seconds = 0;

etc.

updated:
There is more interesting way: use (int) instead.
$epoch = gmmktime((int)$hours, (int)$minutes, (int)$seconds, (int)$month, (int)$day, (int)$year);

vladimir.dolgopolov’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Attached patch will cast to 0 (integer) all NULLs from parsing W3C date/time format.

vladimir.dolgopolov’s picture

Is there any who had tested it?

dvessel’s picture

I tried but can't reproduce.

scoutbaker’s picture

I wasn't able to reproduce the error either.

@vladimir: Were you able to reproduce the error reported by the original poster???

bennybobw’s picture

Status: Needs review » Postponed (maintainer needs more info)

Changing status.

vladimir.dolgopolov’s picture

I think if we use a regexp to parse string we have explicitly cast the matches.

fmosca’s picture

From a few quick tests i found out that $seconds should be $match[7], as $match[6] keeps the ":".
I temporarely added

$seconds = is_numeric($seconds) ? $seconds : $match[7];

before the gmmktime() invocation just to be sure.

j0nathan’s picture

subscribing...

shane birley’s picture

Just ran into this issue:

warning: gmmktime() expects parameter 3 to be long, string given in /drupal/modules/aggregator/aggregator.module on line 668.

As If’s picture

Just ran into this issue.

warning: gmmktime() expects parameter 3 to be long, string given in /var/www/html/modules/aggregator/aggregator.module on line 666

Note that it's line 666 now. This error occurred when I updated a node with a Feed_Field in it (which depends on Aggregator).

Anonymous’s picture

Can anyone confirm whether this is an issue with the latest release of D6? If not, I suggest we close this.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)