Summary | Horde maintenance not listing all applicable tasks for confirmation |
Queue | Horde Framework Packages |
Queue Version | FRAMEWORK_3 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | Horde Developers (at) |
Requester | david-shafer (at) uiowa (dot) edu |
Created | 2006-09-03 (5252 days ago) |
Due | |
Updated | 2006-11-13 (5181 days ago) |
Assigned | 2006-09-25 (5230 days ago) |
Resolved | 2006-11-13 (5181 days ago) |
Milestone | |
Patch | No |
State ⇒ Resolved
State ⇒ Assigned
$this->_needMaintenancePage(), which in this case returns 1, since
'newpage' for the first task (rename_sentmail_monthly) is true.
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ Horde maintenance not listing all applicable tasks for confirmation
Queue ⇒ Horde Framework Packages
the applicable monthly tasks initially. In this case, IMP should be
prompting the user to confirm the rename_sentmail_monthly,
delete_sentmail_monthly, delete_attachments_monthly, and purge_trash
tasks. Instead, it prompts only for the first task,
rename_sentmail_monthly. If I load the base URL for the site again, I
get redirected once again to the confirmation page, and then it
correctly prompts me for all four tasks.
I'm using Horde 3.1.2, but the relevant code doesn't look like it's
changed much recently. The problem seems to be in Maintenance.php. In
runMaintenancePage(), $task_no is set to
$this->_needMaintenancePage(), which in this case returns 1, since
'newpage' for the first task (rename_sentmail_monthly) is true. Then
'newpage' for the first task is set to false. Later in
runMaintenancePage(), $tasks is truncated with array_slice() based on
$task_no, so all but the first task are removed from the list.
When the page ends, the task list is saved to the session, now with
'newpage' for the first task set to false. So on subsequent
maintenance page loads, $task_no doesn't get set, and the task list
isn't truncated.
I think the fix would at least involve moving this line in Maintenance.php:
$task_no = $this->_needMaintenancePage();
below this block:
/* Remove 'newflag' from first task. */
if (!$this->_tasklist->processed(true)) {
if (count($tasks)) {
reset($tasks);
$this->_tasklist->setNewPage(key($tasks), false);
}
}