6.0.0-git
2021-01-19

[#4377] Horde maintenance not listing all applicable tasks for confirmation
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

History
2006-11-13 14:34:43 Jan Schneider Comment #3
State ⇒ Resolved
Reply to this comment
Fixed.
2006-09-25 16:54:02 Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
2006-09-03 20:10:36 david-shafer (at) uiowa (dot) edu Comment #2 Reply to this comment
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.
I misspoke above. The _needMaintenancePage() call returns 0, not 1.
2006-09-03 20:08:29 david-shafer (at) uiowa (dot) edu Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ Horde maintenance not listing all applicable tasks for confirmation
Queue ⇒ Horde Framework Packages
Reply to this comment
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);

   }

}

Saved Queries