The aggregator module uses drupal_set_message in the _cron hook (indirectly), sites using cron.php probably wont notice this but on sites using the poormanscron module these messages will be shown to the user who invoked the _cron hook.

Comments

Steven’s picture

Project: Drupal core » Poormanscron
Component: aggregator.module » Code

Isn't this a poormanscron bug? The module should wipe the drupal messages when it's done.

bart jansens’s picture

Possibly, i wasnt sure if it was a poormanscron or aggregator bug :)

The problem with just wiping all messages is that any existing messages will be erased also.
We could just close the session before invoking the cron hook, i'll try that and see if it causes any other problems.

jsambrook’s picture

Any movement on this? I'm getting complaints from picky (!) users :)

ejort’s picture

StatusFileSize
new1.37 KB

How about something like this patch? It retrieves the drupal messages before the cron run (without deleting them though, in case the cron run fails), then erases the entire set of messages and restores just the saved prior messages when the cron run finishes.

Cheers,
Eric

ejort’s picture

StatusFileSize
new1.43 KB

oops, it seems a spare 's' escaped from my keyboard and into that last patch. Don't worry though, I caught the thing and it's safely secured away now. This patch should actually work.

Cheers,
Eric

josef’s picture

Thanks for the patch, Eric, it's really what i need! Unfortunately I get the following message:

Hunk #1 FAILED at 42.
patch: **** malformed patch at line 36: }

I had a fresh copy of poormanscron.php. Is there any possibility you can look info your patch again?

Regards,
Josef

Uwe Hermann’s picture

Assigned: Unassigned » Uwe Hermann
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new3.71 KB

Here's an updated patch which should apply to the CVS version of poormanscron. I'll commit the patch to CVS in a few minutes, an updated poormanscron tarball should be available for download in a few hours.

In case of problems, please report them here.

Uwe.

Uwe Hermann’s picture

StatusFileSize
new1.28 KB

Oops, sorry, I posted the whole file, not the patch. Here's the correct one...

Uwe Hermann’s picture

Status: Reviewed & tested by the community » Fixed

Marking fixed. I applied the patch to CVS and 4.6.

josef’s picture

Marking fixed. I applied the patch to CVS and 4.6.

Does that mean it should work on the latest Poormanscron module (non-CVS)? I tried but got the following:

Skipping patch.
patch unexpectedly ends in middle of line
2 out of 2 hunks ignored

Good though you posted the whole module file, i just replaced the original one with the new one and it does the job!

josef’s picture

I take the last statement back, it doesn't syndicate new rss posts at all!

Uwe Hermann’s picture

What did you do? The downloadable version for Drupal 4.6 should be fine now, without any patching. Applying any patch to that is doomed to fail. Uwe.

josef’s picture

Oh, it's just me and reading instructions, sorry. I guess it should work now then. Thanks for this great module, Uwe!

Anonymous’s picture

Uwe Hermann’s picture

Status: Fixed » Closed (fixed)