Browse Source

Fixed the bug, was added 2 new conditions in case $index == $this->max_ordered_items
and this condition have a condition of ordered_items by type - Bug #1413

Ricardo Rodriguez 14 years ago
parent
commit
b433d22a1b
1 changed files with 6 additions and 2 deletions
  1. 6 2
      main/newscorm/learnpath.class.php

+ 6 - 2
main/newscorm/learnpath.class.php

@@ -1667,8 +1667,12 @@ class learnpath {
 		}
 		while (!empty ($this->ordered_items[$index]) AND ($this->items[$this->ordered_items[$index]]->get_type() == 'dir' || $this->items[$this->ordered_items[$index]]->get_type() == 'dokeos_chapter') AND $index < $this->max_ordered_items) {
 			$index++;
-			if ($index == $this->max_ordered_items) {
-				return $this->index;
+			if ($index == $this->max_ordered_items){
+				if ($this->items[$this->ordered_items[$index]]->get_type() == 'dir' || $this->items[$this->ordered_items[$index]]->get_type() == 'dokeos_chapter') {
+					return $this->index;
+				} else {
+					return $index;
+				}
 			}
 		}
 		if (empty ($this->ordered_items[$index])) {