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

Deprecation of sql_select_reader completely breaks code that uses it

XMLWordPrintable

    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_29_STABLE
    • MDL-50408_master
    • Hide

      Test 1

      1. Set debug mode to dev level
      2. Install https://github.com/mudrd8mz/moodle-report_overviewstats/tree/release-v1.2 (see that it is not master but release-v1.2 tag)
      3. Go to site admin -> reports -> overview statistics
      4. You SHOULD see a debugging message about using a deprecated interface
      5. You SHOULD NOT see a fatal error
      6. Data SHOULD be displayed

      Test 2

      1. Create a logstore plugin implementing \core\log\sql_internal_reader, install it and then enable it (I've copied and edited the current standard but replacing sql_internal_reader because I haven't found anything in the plugins database)
      2. cd report/overviewstats && git checkout master
      3. Go to site admin -> reports -> overview statistics
      4. You SHOULD see a debugging message about your new logstore plugin
      Show
      Test 1 Set debug mode to dev level Install https://github.com/mudrd8mz/moodle-report_overviewstats/tree/release-v1.2 (see that it is not master but release-v1.2 tag) Go to site admin -> reports -> overview statistics You SHOULD see a debugging message about using a deprecated interface You SHOULD NOT see a fatal error Data SHOULD be displayed Test 2 Create a logstore plugin implementing \core\log\sql_internal_reader, install it and then enable it (I've copied and edited the current standard but replacing sql_internal_reader because I haven't found anything in the plugins database) cd report/overviewstats && git checkout master Go to site admin -> reports -> overview statistics You SHOULD see a debugging message about your new logstore plugin
    • Team Beards Sprint 7

      Some code taken from https://github.com/mudrd8mz/moodle-report_overviewstats.git

      $logmanger = get_log_manager();
      $readers = $logmanger->get_readers('\core\log\sql_select_reader');
      

      From lib/upgrade.txt

      • sql_internal_reader and sql_select_reader interfaces have been deprecated in favour of sql_internal_table_reader
        and sql_reader which use iterators to be more memory efficient.

      \core\log\sql_select_reader has been deprecated in favour of \core\log\sql_reader.

      The problem is that get_readers() now returns an empty array. No deprecation warning telling you to update the code, it doesn't return the old class but it also doesn't give me the new class, just an empty array. So even though the class has been deprecated rather than outright removed the code that uses it is entirely broken without any clue as to why exactly.

            dmonllao David Monllaó
            andyjdavis Andrew Davis
            Andrew Davis Andrew Davis
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Mark Nelson Mark Nelson
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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