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

Some users repeatedly added to data requests queue when delete_existing_deleted_user task is run

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.3.5, 4.4.1, 4.5
    • Privacy
    • MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE

      We've been having a problem in the Moodle site we host here for several years where a small number of users are repeatedly added to the data requests queue every day. These users have long been deleted using the data privacy process, but every time cron runs the tool_dataprivacy\task\delete_existing_deleted_users task, another deletion request is added. This causes problems for our Privacy Officer. After some investigation, I think I've tracked the problem down. In [the code for that task available on github|http://github.com], you can find the following SQL query which determines which users to add a request for:

                  SELECT DISTINCT(u.id)
                        FROM {user} u
                   LEFT JOIN {tool_dataprivacy_request} r
                             ON u.id = r.userid
                       WHERE u.deleted = ?
                             AND (r.id IS NULL
                                 OR r.type != ?)

      And when I run this in Adminer with the correct values for our instance, it spits out the problem user IDs. Investigating why, I think it's because these users have previously made requests to export their data prior to it being deleted, and the SQL reads to me like it's checking for any type of data request that isn't a deletion request, rather than checking to see if there are any deletion requests. When I went in on a test server and changed those non-deletion requests to the deletion type, and re-ran the task, those users were no longer added to the queue.

      We're using the long term stable version of Moodle (4.1.4+), and can't easily upgrade to see if it's fixed in the new updates, so I can't confirm if this is still an issue in the new versions. I hope you understand.

            Unassigned Unassigned
            DL David L
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

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

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