It is fairly clear that system_run_automated_cron() will also call hook_cron during a normal request if cron.php has not been run within the given threshold period. This should be noted in the documentation for hook_cron.

CommentFileSizeAuthor
#3 1041440.patch708 bytesjhodgdon

Comments

arianek’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Correction/Clarification » documentation

api docs, moving to core queue

jhodgdon’s picture

OK. drupal_cron_run() is the function that actually invokes hook_cron(), and there are 5 functions in d7 that call it, plus cron.php. So the doc should be updated.
http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_cr...

jhodgdon’s picture

Status: Active » Needs review
StatusFileSize
new708 bytes

I think the best fix for the doc is just to delete that line, since the next paragraph explains when hook_cron() gets invoked.

Here's a patch.

kim-day’s picture

I tested the patch and it works correctly - looks good

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

marking rtbc as per kim-day's review

jhodgdon’s picture

Version: 7.x-dev » 8.x-dev

Needs to go to d8 and then d7

dries’s picture

Version: 8.x-dev » 7.x-dev

Committed to 8.x. Moving to 7.x.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.