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

Myoverview block incorrectly implements Privacy API

XMLWordPrintable

    • MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • wip-MDL-61966-master
    • 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.

      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.

            abgreeve Adrian Greeve
            gb2048 Gareth J Barnard
            Ryan Wyllie Ryan Wyllie
            Jun Pataleta Jun Pataleta
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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