<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Horde maintenance not listing all applicable tasks for confirmation</title> 
  <pubDate>Fri, 10 Apr 2026 14:48:31 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/4377</link> 
  <atom:link rel="self" type="application/rss+xml" title="Horde maintenance not listing all applicable tasks for confirmation" href="https://bugs.horde.org/ticket/4377/rss" /> 
  <description>Horde maintenance not listing all applicable tasks for confirmation</description> 
 
   
   
  <item> 
   <title>The Horde maintenance task confirmation page isn&#039;t displayin</title> 
   <description>The Horde maintenance task confirmation page isn&#039;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&#039;m using Horde 3.1.2, but the relevant code doesn&#039;t look like it&#039;s changed much recently. The problem seems to be in Maintenance.php.  In runMaintenancePage(), $task_no is set to $this-&gt;_needMaintenancePage(), which in this case returns 1, since &#039;newpage&#039; for the first task (rename_sentmail_monthly) is true. Then &#039;newpage&#039; 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 &#039;newpage&#039; for the first task set to false. So on subsequent maintenance page loads, $task_no doesn&#039;t get set, and the task list isn&#039;t truncated.



I think the fix would at least involve moving this line in Maintenance.php:



$task_no = $this-&gt;_needMaintenancePage();



below this block:



/* Remove &#039;newflag&#039; from first task. */

if (!$this-&gt;_tasklist-&gt;processed(true)) {

  if (count($tasks)) {

    reset($tasks);

    $this-&gt;_tasklist-&gt;setNewPage(key($tasks), false);

  }

}</description> 
   <pubDate>Sun, 03 Sep 2006 20:08:29 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4377#t23718</link> 
  </item> 
   
  <item> 
   <title>&gt; In runMaintenancePage(), $task_no is set to 

&gt; $this-&gt;_ne</title> 
   <description>&gt; In runMaintenancePage(), $task_no is set to 

&gt; $this-&gt;_needMaintenancePage(), which in this case returns 1, since 

&gt; &#039;newpage&#039; for the first task (rename_sentmail_monthly) is true.



I misspoke above. The _needMaintenancePage() call returns 0, not 1.</description> 
   <pubDate>Sun, 03 Sep 2006 20:10:36 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4377#t23719</link> 
  </item> 
   
  <item> 
   <title>Fixed.</title> 
   <description>Fixed.</description> 
   <pubDate>Mon, 13 Nov 2006 14:34:43 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4377#t25989</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
