Commit bcc6c92a authored by sun's avatar sun

#424524 by John Money, sun: Fixed site not reset on all cron runs.

parent 361421de
......@@ -6,6 +6,7 @@ Demo x.x-x.x, xxxx-xx-xx
Demo 5.x-1.x, xxxx-xx-xx
------------------------
#424524 by John Money, sun: Fixed site not reset on all cron runs.
#393186 by sun: Fixed fatal error: Only variables can be passed by reference.
#372113 by sun: Fixed not all cache tables are skipped.
#369711 by smk-ka: Added confirmation before deleting a snapshot.
......
......@@ -99,7 +99,6 @@ function demo_block($op = 'list', $delta = 0, $edit = array()) {
}
function demo_reset_now() {
$form = array();
$form['redirect'] = array(
'#type' => 'value',
'#value' => $_GET['q'],
......@@ -129,10 +128,11 @@ function demo_reset_now_submit($form_id, $values) {
function demo_cron() {
if ($interval = variable_get('demo_reset_interval', 0)) {
// See if it's time for a reset.
if ((time() - $interval) >= variable_get('demo_reset_last', 0)) {
$time = $_SERVER['REQUEST_TIME'];
if (($time - $interval) >= variable_get('demo_reset_last', 0)) {
require_once drupal_get_path('module', 'demo') .'/demo.admin.inc';
demo_reset(variable_get('demo_dump_cron', 'demo_site'), FALSE);
variable_set('demo_reset_last', time());
variable_set('demo_reset_last', $time);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment