Skip to content

Commit

Permalink
Bug #9767: Fix setting pointer if system tasks are also run
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Nov 1, 2011
1 parent 4be2fc8 commit 4348780
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions framework/LoginTasks/lib/Horde/LoginTasks/Tasklist.php
Expand Up @@ -89,12 +89,12 @@ public function addTask($task)
*/
public function ready($advance = false)
{
$tmp = array();
$stasks = $tasks = array();

/* Always loop through system tasks first. */
foreach ($this->_stasks as $key => $val) {
if (!$val->skip()) {
$tmp[] = $val;
$stasks[] = $val;
unset($this->_stasks[$key]);
}
}
Expand All @@ -104,15 +104,15 @@ public function ready($advance = false)
if ($v->needsDisplay() && ($k >= $this->_ptr)) {
break;
}
$tmp[] = $v;
$tasks[] = $v;
}

if ($advance) {
$this->_tasks = array_slice($this->_tasks, count($tmp));
$this->_tasks = array_slice($this->_tasks, count($tasks));
$this->_ptr = 0;
}

return $tmp;
return array_merge($stasks, $tasks);
}

/**
Expand Down

0 comments on commit 4348780

Please sign in to comment.