Fix doodle autocloser

This commit is contained in:
Tim Düsterhus
2025-09-21 19:17:11 +02:00
committed by Derick Rethans
parent 55cecbb6de
commit 575aed30b4

View File

@@ -141,10 +141,6 @@ class syntax_plugin_doodle extends DokuWiki_Syntax_Plugin
if (strcmp($name, "CLOSEON") == 0) {
if (($timestamp = strtotime($value)) !== false) {
$params['close_on_ts'] = $timestamp;
if (time() > $timestamp) {
$params['closed'] = 1;
}
}
} else
if (strcmp($name, "CLOSED") == 0) {
@@ -211,6 +207,14 @@ class syntax_plugin_doodle extends DokuWiki_Syntax_Plugin
//debout('data in render', $data);
// The auto-closer logic depends on the current time() and thus needs
// to happen in render(), since the result of handle() is cached.
if (isset($data['params']['close_on_ts'])) {
if (time() > $data['params']['close_on_ts']) {
$data['params']['closed'] = 1;
}
}
$this->params = $data['params'];
$this->choices = $data['choices'];
$this->doodle = array();