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

Myoverview block incorrectly implements Privacy API

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.5, 3.4.2, 3.5
    • Fix Version/s: 3.3.6, 3.4.3
    • Component/s: Blocks, Privacy
    • Labels:
    • Testing Instructions:
      Hide

      This requires running a script from the command prompt

      • This also requires a course and students enrolled in that course.
      1. Log in as a student. Make note of the user id for this student.
      2. Go to 'Dashboard'
      3. In the course overview block (in the middle) click the tab and leave it selected on either Timeline or Courses.
      4. Update the attached script and change: $user = \core_user::get_user(3); To the user ID that you made note of.
      5. Run the attached script from the command line. – php testexport.php
      6. Copy the location mentioned on the last line into your file browser and view the contents of the .json file. The json file should be under "System > User preferences"
      7. Verify that it contains the preference that you selected for the tab in the course overview block.
      Show
      This requires running a script from the command prompt This also requires a course and students enrolled in that course. Log in as a student. Make note of the user id for this student. Go to 'Dashboard' In the course overview block (in the middle) click the tab and leave it selected on either Timeline or Courses. Update the attached script and change: $user = \core_user::get_user(3); To the user ID that you made note of. Run the attached script from the command line. – php testexport.php Copy the location mentioned on the last line into your file browser and view the contents of the .json file. The json file should be under "System > User preferences" Verify that it contains the preference that you selected for the tab in the course overview block.
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-61966-master

      Description

      The 'myoverview' ('/blocks/myoverview') block records the user preference for the state of its tabs.  For example in lib.php there is:

      ````

      function block_myoverview_user_preferences() {
      $preferences = array();
      $preferences['block_myoverview_last_tab'] = array(
      'type' => PARAM_ALPHA,
      'null' => NULL_NOT_ALLOWED,
      'default' => BLOCK_MYOVERVIEW_TIMELINE_VIEW,
      'choices' => array(BLOCK_MYOVERVIEW_TIMELINE_VIEW, BLOCK_MYOVERVIEW_COURSES_VIEW)
      );

      return $preferences;
      }

      ````

      being the user preference 'block_myoverview_last_tab'.  However in 'classes/privacy/provider.php' the 'null_provider' class is implemented 'class provider implements \core_privacy\local\metadata\null_provider' indicating that no user data is stored.  This is clearly not the case.  The language file states 'The Course overview block only shows data stored in other locations.' but it stores a user preference pertaining to a user id.

        Attachments

        1. testexport.php
          1 kB
          Adrian Greeve
        2. Verified_MDL-61966.PNG
          58 kB
          Gladys Basiana

          Activity

            People

            Assignee:
            abgreeve Adrian Greeve
            Reporter:
            gb2048 Gareth J Barnard
            Peer reviewer:
            Ryan Wyllie
            Integrator:
            Jun Pataleta
            Tester:
            Gladys Basiana
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

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

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 20 minutes
                20m