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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2, 2.3
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Database SQL/XMLDB
    • Labels:
      None

      Description

      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!)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Mar/12