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

fix moodle_database::execute() comment or change database_manager::execute_sql to public function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.1.5, 2.2.2
    • 2.1.4, 2.2, 2.3
    • Database SQL/XMLDB
    • None

      moodle_database.php execute() function has this comment:
      Do NOT use this to make changes in db structure, use database_manager::execute_sql() instead!

      but - execute_sql() is a protected function so we can't use it.

      We have some custom code that uses custom views/functions and it's a lot easier to create these on the db importing a pg_dump file. - they don't use moodle prefix etc. $DB->execute does the prefix/params stuff and it would be nice to be able to avoid that if poss.

      It would be nice to be able to just use $dbman->execute_sql to do this and according to the comment in moodle_database.php it looks like someone thought it should be supported at some point.

      Can we please either - change the function to a public one - or remove the invalid comments in moodle_database.php that tell us to use it. (my preference is to change to public!)

            skodak Petr Skoda (Inactive)
            danmarsden Dan Marsden
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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