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

mod/data/filter.php: text data not quoted in Data autolinking filter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.7.7, 1.8.8, 1.9.4
    • Fix Version/s: 1.7.7+, 1.8.9, 1.9.5
    • Labels:
      None
    • Environment:
      PostgreSQL 8.x
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      Data(base) module autolinking filter tries to compare an integer value an an text field, which of course fails in Postgres.

      A patch (for 1.9.x) is attached.

      Error and stack trace:
      ====

      ERROR: operator does not exist: text = integer LINE 1: ...D dr.id = dc.recordid AND df.type = 'text' AND df.param1 = 1 ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

      SELECT dc.id AS contentid, dr.id AS recordid, dc.content AS content, d.id AS dataid FROM mdl_data d, mdl_data_fields df, mdl_data_records dr, mdl_data_content dc WHERE (d.course = '9' or d.course = '1')AND d.id = df.dataid AND df.id = dc.fieldid AND d.id = dr.dataid AND dr.id = dc.recordid AND df.type = 'text' AND df.param1 = 1

      • line 692 of lib/dmllib.php: call to debugging()
      • line 972 of lib/dmllib.php: call to get_recordset_sql()
      • line 44 of mod/data/filter.php: call to get_records_sql()
      • line 1785 of lib/weblib.php: call to data_filter()
      • line 1535 of lib/weblib.php: call to filter_text()
      • line 31 of blocks/html/block_html.php: call to format_text()
      • line 317 of blocks/moodleblock.class.php: call to block_html->get_content()
      • line 240 of lib/blocklib.php: call to block_base->is_empty()
      • line 79 of course/format/topics/format.php: call to blocks_have_content()
      • line 226 of course/view.php: call to require()

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              mylescarrick Myles Carrick
              Tester:
              Petr Skoda
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/09