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

Named query parameters cannot be used more than once

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 2.0
    • Database SQL/XMLDB
    • None
    • MySQL
    • MOODLE_20_STABLE

      Currenty, when trying to use the same named query parameter in more than one place, Moodle reports an error such as:

      ERROR: Incorrect number of query parameters. Expected 2, got 1.

      This appear to happen because the code checking for the number of named parameters does not account for re-use:

      $named_count = preg_match_all('/(?<!:[a-z][a-z0-9_]*/', $sql, $named_matches);

      I have encountered this problem in Moodle 2.0, and the associated code appears to be unchanged in 2.1dev.

            stronk7 Eloy Lafuente (stronk7)
            brendan.rollinson Brendan Rollinson (Inactive)
            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.