Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-39801

navigationlib.php navigation_node_collection::remove fails

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.7, 2.4.4, 2.5, 2.6
    • 2.3.8, 2.4.5, 2.5.1
    • Navigation
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • wip-MDL-39801-master
    • Hide

      This can not be reproduced in core since function navigation_node::remove() is almost not used. It may occur when themes or other contributed plugins attempt to remove a navigation node.

      Review the commits and run unit tests.

      Show
      This can not be reproduced in core since function navigation_node::remove() is almost not used. It may occur when themes or other contributed plugins attempt to remove a navigation node. Review the commits and run unit tests.

    Description

      navigationlib.php:902 if ($node->key == $key && $node->type == $type)
      This test always returns true for the first element of the $this->collection
      Hard to find out why my theme was not removing the good item !

      Solution :
      if ($node->key === $key && $node->type === $type)
      Maybe the test is not ok also l.2561 and l.4397 .

      Thanks for your work.

      Attachments

        Issue Links

          Activity

            People

              marina Marina Glancy
              lartet Florent Lartet
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Jul/13