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

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Testing Instructions:
      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
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w12_MDL-29894_m23_objectparams

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Jun/12