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

GDPR export: Context paths can be very long, not unique

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.5.5, 3.6.3
    • 3.5.3
    • Privacy
    • MOODLE_35_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • Hide

      Pre-requisites

      1. Create a course with the name "Website D849-12E Introduction to programing"
      2. Within the course, create three wikis with names:
        1. Sample wiki with name exceeds 32 characters 1
        2. Sample wiki with name exceeds 32 characters 2
        3. Short wiki
      3. Enrol another user into the course
      4. Login as that user
      5. Edit the wiki content (just open each wiki, press Edit, and save changes)

      Test

      1. Perform data export for the relevant user
      2. Open the folder containing the exported content
      3. Locate the folder for the course
        1. Confirm that the name of the folder was shortened to:

          Course Website D849-12E Introdu… _.{contextid}
          

      4. Locate the folder for the three activities
        1. Confirm that the two longer named wikis had folder names shortened to:

          Wiki Sample wiki with name exce… _.\{contextid}
          

        2. Confirm that the "Short wiki" was not shortened
        3. Confirm that all three had a contextid at the end of the folder name in the form .[contextid]
      5. Navigate back to the top folder of the export
      6. Open the index.html in your browser
      7. Locate the course
        1. Confirm that the name in the navigation was shortened to:

          Course Website D849-12E Introdu…
          

      8. Open the data.json for that course
        1. Confirm that the full course name is also shown on the page without being shortened
      9. Locate the three wiki activities in the navigation tree
        1. Confirm that the two longer named wikis had names shortened to:

          Wiki Sample wiki with name exce…
          

        2. Confirm that the "Short wiki" was not shortened
      10. For each wiki, open the data.json file
        1. Confirm that the full name of the wiki was also included
           
      Show
      Pre-requisites Create a course with the name " Website D849-12E Introduction to programing " Within the course, create three wikis with names: Sample wiki with name exceeds 32 characters 1 Sample wiki with name exceeds 32 characters 2 Short wiki Enrol another user into the course Login as that user Edit the wiki content (just open each wiki, press Edit, and save changes) Test Perform data export for the relevant user Open the folder containing the exported content Locate the folder for the course Confirm that the name of the folder was shortened to: Course Website D849-12E Introdu… _.{contextid} Locate the folder for the three activities Confirm that the two longer named wikis had folder names shortened to: Wiki Sample wiki with name exce… _.\{contextid} Confirm that the "Short wiki" was not shortened Confirm that all three had a contextid at the end of the folder name in the form . [contextid] Navigate back to the top folder of the export Open the index.html in your browser Locate the course Confirm that the name in the navigation was shortened to: Course Website D849-12E Introdu… Open the data.json for that course Confirm that the full course name is also shown on the page without being shortened Locate the three wiki activities in the navigation tree Confirm that the two longer named wikis had names shortened to: Wiki Sample wiki with name exce… Confirm that the "Short wiki" was not shortened For each wiki, open the data.json file Confirm that the full name of the wiki was also included  

      When writing GDPR extracts, the path names used to represent contexts within the system can be very long. This contributes to problems for users on Windows (see MDL-62617).

      In addition, the paths can be strange - where a context id would normally appear, if it is very long, the context id is not included and instead there is a hash at the end of the string. This seems to me like a bug.

      Here is an example context path (this is a real example from our system so please forgive the weird bits):

      System 1/Category Recycle bin_.2629538/Website D849-12E Introduction to quantitative and qualitative research methods_.602872/Wiki Activity 2.72.8 wiki advantages and disadvantages of self-completion questionnaire - d52285d245/

      This path is 226 characters long and we haven't even had any files or data yet. In addition, look at the last element of the path:

      Wiki Activity 2.72.8 wiki advantages and disadvantages of self-completion questionnaire - d52285d245

      The logic used to construct each element, in the function get_context_path in privacy/classes/local/request/moodle_context_writer.php, is:

      1. Get the context name
      2. Add on a space and the context id
      3. Trim to max 100 characters, adding weird hash if it's longer.

      In this case, the frankly weird name of the wiki is already longer than 100 characters, which means that the context id gets trimmed off.

      I propose this solution to both improve the chance of it working in Windows, and also consistently include the context id:

      1. Get the context name and trim this to a more reasonable length, say 32 characters.
      2. Then add on the _. and context id.

      The context path will always be unique (because of having the id in) and will not be too long. The example given would turn into

      System 1/Category Recycle bin_.2629538/Website D849-12E Introduction t....602872/Wiki Activity 2.72.8 wiki advan....943106/

      Which is a much more reasonable 120-ish characters long, and now if there are two wikis with a similar name, they can be distinguished by context ids, instead of by arbitrary hashes.

        1. MDL-64291-Export.zip
          146 kB
        2. MDL-64291-Export.zip
          146 kB
        3. screenshot-1.png
          screenshot-1.png
          295 kB

            kietlyc Kiet Ly
            quen Sam Marshall
            Sam Marshall Sam Marshall
            Andrew Lyons Andrew Lyons
            Janelle Barcega Janelle Barcega
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.