[Tickets #4377] NEW: Horde maintenance not listing all applicable tasks for confirmation

bugs@bugs.horde.org bugs at bugs.horde.org
Sun Sep 3 13:08:29 PDT 2006


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=4377
-----------------------------------------------------------------------
 Ticket             | 4377
 Created By         | david-shafer at uiowa.edu
 Summary            | Horde maintenance not listing all applicable tasks for confirmation
 Queue              | Horde Framework Packages
 Version            | FRAMEWORK_3
 Type               | Bug
 State              | Unconfirmed
 Priority           | 2. Medium
 Owners             | 
-----------------------------------------------------------------------


david-shafer at uiowa.edu (2006-09-03 13:08) wrote:

The Horde maintenance task confirmation page isn't displaying all of 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);
  }
}




More information about the bugs mailing list