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

Prevent duplicate keys in navigation nodes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7 regressions, 3.9.4, 3.10.1
    • Fix Version/s: None
    • Component/s: Navigation
    • Testing Instructions:
      Hide
      1. Install format_tiles with default settings (see description for link)
      2. Install local_extension with default settings (see description for link)
      3. Open /local/extension/rules/manage.php
      4. Enter 'Rule Name': `Test rule` and click 'Save Changes'
      5. Open /admin/tool/generator/maketestcourse.php
      6. Enter values:
         - Size of course:  'XS (~10KB; create in ~1 second)'
         - Course short name: 'Test course'
      7. Create course
      8. Edit course settings and change course format to 'Tiles Format'
      9. Click 'Save and return'
      10. Then 'Turn Editing on' and Delete 'Tile 1' and hit delete in the Confirm box
      11. Click 'Participants' in the navigation , then 'Enroll users' and  add yourself as a Student
      12. Go back to your home 'Test course' page
      13. You'll see the stacktrace at the top of the page
      14. git cherry-pick 95c956b0e3ef7831e0f811f37919e178dd511e02
      15. You'll no longer get the debugging message

       

      Show
      Install format_tiles with default settings (see description for link) Install local_extension with default settings (see description for link) Open /local/extension/rules/manage.php Enter 'Rule Name': `Test rule` and click 'Save Changes' Open /admin/tool/generator/maketestcourse.php Enter values:  - Size of course:  'XS (~10KB; create in ~1 second)'  - Course short name: 'Test course' Create course Edit course settings and change course format to 'Tiles Format' Click 'Save and return' Then 'Turn Editing on' and Delete 'Tile 1' and hit delete in the Confirm box Click 'Participants' in the navigation , then 'Enroll users' and  add yourself as a Student Go back to your home 'Test course' page You'll see the stacktrace at the top of the page git cherry-pick 95c956b0e3ef7831e0f811f37919e178dd511e02 You'll no longer get the debugging message  
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_39_STABLE
    • Pull 3.11 Branch:
      MDL-70923-MOODLE_311_STABLE
    • Pull Master Branch:
      MDL-70923-master

      Description

      Steps to reproduce:

      1.Install format_tiles with default settings

      git clone https://bitbucket.org/dw8/moodle-format_tiles.git course/format/tiles
      

      2.(only for Moodle 3.7) Change branch of format tiles to moodle37:

      cd course/fomat/tiles && git checkout moodle37

      3.Install local_extension with default settings

      git clone git@github.com:central-queensland-uni/moodle-local_extension.git local/extension
      

      4.Open

      /local/extension/rules/manage.php
      

      5.Enter 'Rule Name': `Test rule` and click 'Save Changes'

      6.Open

      /admin/tool/generator/maketestcourse.php
      

      7.Enter values:

      8.Size of course:  'XS (~10KB; create in ~1 second)'

      9.Course short name: 'Test course'

      10.Create course

      11.Edit course settings and change course format to 'Tiles Format'

      12.Click 'Save and return'

      13.Then 'Turn Editing on' and Delete 'Tile 1' and hit delete in the Confirm box

      14.Click 'Participants' in the navigation , then 'Enroll users' and  add yourself as a Student

      15.Go back to your home 'Test course' page

      16.You'll see the stacktrace at the top

       


      Before fix:

      • You see the following stacktrace:

      Navigation node intersect: Adding a node that already exists 7
      line 946 of /lib/navigationlib.php: call to debugging()
      line 4065 of /lib/navigationlib.php: call to navigation_node_collection->add()
      line 443 of /lib/navigationlib.php: call to flat_navigation->add()
      line 446 of /lib/navigationlib.php: call to navigation_node->build_flat_navigation_list()
      line 4016 of /lib/navigationlib.php: call to navigation_node->build_flat_navigation_list()
      line 771 of /lib/pagelib.php: call to flat_navigation->initialise()
      line 820 of /lib/pagelib.php: call to moodle_page->magic_get_flatnav()
      line 54 of /theme/boost/layout/columns2.php: call to moodle_page->__get()
      line 1374 of /lib/outputrenderers.php: call to include()
      line 1304 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      line 244 of /course/view.php: call to core_renderer->header()
      

      * Also see screenshot Before.png

       


      After fix:

      • No stacktrace
      • Also see After.png

       


      The fix:

      master: https://github.com/moodle/moodle/compare/master...ScottVerbeek:MDL-70923-master
      MOODLE_37_STABLE: https://github.com/moodle/moodle/compare/MOODLE_37_STABLE...ScottVerbeek:MDL-70923-MOODLE_37_STABLE
      MOODLE_311_STABLE: https://github.com/moodle/moodle/compare/MOODLE_311_STABLE...ScottVerbeek:MDL-70923-MOODLE_311_STABLE

        Attachments

        1. After.png
          After.png
          224 kB
        2. Before.png
          Before.png
          259 kB

          Activity

            People

            Assignee:
            hdagheda Heena Agheda
            Reporter:
            scottverbeek Scott Verbeek
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: