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

moodle_content_writer assumes context names will be unique to build context path

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.3.6, 3.4.3
    • Component/s: Privacy
    • Labels:
    • Testing Instructions:
      Hide
      1. Log in as admin
      2. Set the theme to the Clean theme
      3. View the dashboard
      4. Hide (collapse) the “private files” block
      5. Go to the profile page
        • user menu > profile
      6. Add the “private files” block to this page
      7. Dock the private files block
      8. Download the attached testfinal.php script and run it from your moodle root directory to generate an export of the admin user data
        • Note: you may need to edit the script and set the user id to match the admin user id on your system
      9. View the admin user context folder in the export (it should be System > User <admin user’s name>)
      10. CONFIRM that there are two separate folders for “Block Private files” each with a different number at the end of the folder name
      Show
      Log in as admin Set the theme to the Clean theme View the dashboard Hide (collapse) the “private files” block Go to the profile page user menu > profile Add the “private files” block to this page Dock the private files block Download the attached testfinal.php script and run it from your moodle root directory to generate an export of the admin user data Note: you may need to edit the script and set the user id to match the admin user id on your system View the admin user context folder in the export (it should be System > User <admin user’s name>) CONFIRM that there are two separate folders for “Block Private files” each with a different number at the end of the folder name
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-62285-master

      Description

      The moodle_content_writer::get_context_path() function uses the context name to build the path for the context however context names are not guaranteed to be unique, for example with blocks.

      You can add two separate instances of the same block in the same context (for example one on the dashboard and one on the user profile page) which will result in the same path being generated for two separate block instances.

        Attachments

        1. Step10_MDL-62285.PNG
          Step10_MDL-62285.PNG
          9 kB
        2. Step9_MDL-62285.PNG
          Step9_MDL-62285.PNG
          12 kB
        3. testfinal.php
          1 kB

          Issue Links

            Activity

              People

              Assignee:
              ryanwyllie Ryan Wyllie
              Reporter:
              ryanwyllie Ryan Wyllie
              Peer reviewer:
              Sara Arjona (@sarjona)
              Integrator:
              Andrew Nicols
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/18

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 30 minutes
                  30m