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

Exception occurred while calling editor_atto\privacy\provider::export_user_data

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-64737-master-attoprivacysql
    • Testing Instructions:
      Hide

      Execute these two testsuites:

      $ vendor/bin/phpunit --testsuite=editor_atto_testsuite
      $ vendor/bin/phpunit --testsuite=core_userkey_testsuite
      

      For each of them

      • make sure there are actually some tests executed
      • make sure they pass
      Show
      Execute these two testsuites: $ vendor/bin/phpunit --testsuite=editor_atto_testsuite $ vendor/bin/phpunit --testsuite=core_userkey_testsuite For each of them make sure there are actually some tests executed make sure they pass

      Description

      This has been reported by Mary Cooch and Helen Foster as affecting the personal data requests on moodle community sites. We are receiving the following exception.

      Exception occurred while calling editor_atto\privacy\provider::export_user_data.
      This means that plugin editor_atto did not complete the processing of data. The following exception information may be passed on to the plugin developer:
       
      ERROR: missing param "param60" in query
       
      #0 /var/www/html/lib/dml/mysqli_native_moodle_database.php(1178): moodle_database->fix_sql_params('SELECT *\n ...', Array)
      #1 /var/www/html/lib/editor/atto/classes/privacy/provider.php(138): mysqli_native_moodle_database->get_recordset_sql('SELECT *\n ...', Array)
      #2 /var/www/html/lib/moodlelib.php(7858): editor_atto\privacy\provider::export_user_data(Object(core_privacy\local\request\approved_contextlist))
      #3 /var/www/html/privacy/classes/manager.php(578): component_class_callback('editor_atto
      pri...', 'export_user_dat...', Array)
      #4 /var/www/html/privacy/classes/manager.php(611): core_privacy\manager::component_class_callback('editor_atto', 'core_privacy
      lo...', 'export_user_dat...', Array)
      #5 /var/www/html/privacy/classes/manager.php(339): core_privacy\manager->handled_component_class_callback('editor_atto', 'core_privacy
      lo...', 'export_user_dat...', Array)
      #6 /var/www/html/admin/tool/dataprivacy/classes/task/process_data_request_task.php(113): core_privacy\manager->export_user_data(Object(core_privacy\local\request\contextlist_collection))
      #7 /var/www/html/lib/cronlib.php(259): tool_dataprivacy\task\process_data_request_task->execute()
      #8 /var/www/html/lib/cronlib.php(147): cron_run_inner_adhoc_task(Object(tool_dataprivacy\task\process_data_request_task))
      #9 /var/www/html/lib/cronlib.php(68): cron_run_adhoc_tasks(1548845762)
      #10 /var/www/html/admin/cli/cron.php(61): cron_run()
      

      This seems to be a regression of MDL-62601 as currently, the method \editor_atto\privacy\provider::export_user_data() in the lib/editor/atto/classes/privacy/provider.php is apparently wrong as it works with an undefined variable contextsql in the first query there.

      Easily to reproduce:

      $ vendor/bin/phpunit lib/editor/atto/tests/privacy_provider.php
      

      I was wondering why this has not been caught by our automatic unit test runs as it clearly fails. I realized the problem is with incorrectly named testsuite file. Only files ending with "_test.php" suffix are implicit part of a testsuite. So our PHPUnit infrastructure has always skipped this file (and one other I found) and it was never detected.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mudrd8mz David Mudrák (@mudrd8mz)
              Reporter:
              mudrd8mz David Mudrák (@mudrd8mz)
              Peer reviewer:
              Carlos Escobedo Carlos Escobedo
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              CiBoT CiBoT
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Nov/18