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

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.4, 2.2, 2.3
    • 2.1.5, 2.2.2
    • Database SQL/XMLDB
    • 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

            skodak Petr Skoda
            danmarsden Dan Marsden
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12/Mar/12