Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29516 DB layer improvements 2.3 META
  3. MDL-29894

Prevent objects to be passed to moodle_database as params

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • Blocker
    • 2.3
    • 2.2
    • Database SQL/XMLDB
    • None
    • MOODLE_22_STABLE
    • MOODLE_23_STABLE
    • w12_MDL-29894_m23_objectparams
    • Easy
    • Hide

      1/ run functional DB tests for all 5 supported drivers
      2/ try install for one DB type (they all throw the same errors now)
      3/ browse around a bit - please report any regressions here or as separate issues

      Show
      1/ run functional DB tests for all 5 supported drivers 2/ try install for one DB type (they all throw the same errors now) 3/ browse around a bit - please report any regressions here or as separate issues

    Description

      Before 2.2, the behavior of passing objects to moodle_database methods was undefined and, up to some point, the __toString() magic method was doing its work in a few cases.

      But it was not fully supported nor cross-db (MDL-29339) so finally it has been decided to be stricter and prevent (coding exception) any use of objects being passed as params. Caller should perform always the cast instead.

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              stronk7 Eloy Lafuente (stronk7)
              Dan Poltawski Dan Poltawski
              Aparup Banerjee Aparup Banerjee
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                25/Jun/12