Index: includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.205 diff -u -p -r1.205 file.inc --- includes/file.inc 1 Feb 2010 19:07:07 -0000 1.205 +++ includes/file.inc 16 Feb 2010 02:42:40 -0000 @@ -1644,6 +1644,10 @@ function file_scan_directory($dir, $mask $options['key'] = in_array($options['key'], array('uri', 'filename', 'name')) ? $options['key'] : 'uri'; $files = array(); + // Temporary hack for http://drupal.org/node/706608 + if (getcwd() != DRUPAL_ROOT) { + chdir(DRUPAL_ROOT); + } if (is_dir($dir) && $handle = opendir($dir)) { while (FALSE !== ($filename = readdir($handle))) { if (!preg_match($options['nomask'], $filename) && $filename[0] != '.') { Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1232 diff -u -p -r1.1232 node.module --- modules/node/node.module 15 Feb 2010 19:00:30 -0000 1.1232 +++ modules/node/node.module 16 Feb 2010 02:42:40 -0000 @@ -1059,6 +1059,15 @@ function node_save($node) { // Clear the page and block caches. cache_clear_all(); + // Temporary fix for http://drupal.org/node/221081 + entity_get_controller('node')->resetCache(); + + // Request that cron be triggered on the current page load, if the site is + // configured to perform automated cron runs. This allows any overall site + // updates associated with the node (for example, search index updates) to + // immediately take effect. + system_request_automated_cron_run(TRUE); + // Ignore slave server temporarily to give time for the // saved node to be propagated to the slave. db_ignore_slave(); Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.889 diff -u -p -r1.889 system.module --- modules/system/system.module 13 Feb 2010 21:41:58 -0000 1.889 +++ modules/system/system.module 16 Feb 2010 02:42:40 -0000 @@ -3094,12 +3094,46 @@ function system_page_alter(&$page) { } /** + * Trigger an automated cron run on the current page request. + * + * Normally, if Drupal is configured to run cron automatically, it will only + * run it once within the specified cron interval (e.g., once every three + * hours). This function, however, can be used to trigger an automated cron + * run at the end of the current page request, regardless of the last time + * cron was run. For example, it might be used if the site's content was + * changed during the current page request, thereby requiring updates that are + * normally performed during cron to immediately take effect. + * + * Note that if the automated cron facility is turned off (i.e., if the + * 'cron_safe_threshold' variable is set to 0), then Drupal will not perform + * any automated cron runs by default, and this function will not have any + * effect. + * + * @param $value + * By default, no request to run cron will be made. Set to TRUE in order to + * request that cron be run at the end of this page load, or FALSE to cancel + * a previous request. + * + * @return + * TRUE if a cron run was requested, or FALSE otherwise. + * + * @see system_run_automated_cron() + */ +function system_request_automated_cron_run($value = NULL) { + $run_cron = &drupal_static(__FUNCTION__, FALSE); + if (isset($value)) { + $run_cron = $value; + } + return $run_cron; +} + +/** * Run the automated cron if enabled. */ function system_run_automated_cron() { if (($threshold = variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD)) > 0) { $cron_last = variable_get('cron_last', NULL); - if (!isset($cron_last) || (REQUEST_TIME - $cron_last > $threshold)) { + if (!isset($cron_last) || (REQUEST_TIME - $cron_last > $threshold) || system_request_automated_cron_run()) { drupal_cron_run(); } }