Moodle
  1. Moodle
  2. MDL-31085

invalid sql in filter/data/filter.php

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.2
    • Component/s: Filters
    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide
      • Enable the database filter and apply it to content
      • Visit a course page or any page with content (e.g. page)
      • Add some content (e.g. label, or topic description)

      Expected Result

      Page displayed correctly

      Actual Result

      Page goes bang

      Show
      Enable the database filter and apply it to content Visit a course page or any page with content (e.g. page) Add some content (e.g. label, or topic description) Expected Result Page displayed correctly Actual Result Page goes bang
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull Master Branch:
      master_MDL-31085
    • Rank:
      37510

      Description

      Debug info: ERROR: operator does not exist: text = integer
      LINE 8: 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
      JOIN mdl_data_fields df ON df.dataid = d.id
      JOIN mdl_data_records dr ON dr.dataid = d.id
      JOIN mdl_data_content dc ON dc.fieldid = df.id AND dc.recordid = dr.id
      WHERE d.course = $1
      AND df.type = 'text'
      AND df.param1 = 1
      [array (
      0 => '180',
      )]
      Stack trace:

      line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 678 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 76 of /filter/data/filter.php: call to pgsql_native_moodle_database->get_records_sql()
      line 157 of /lib/filterlib.php: call to filter_data->filter()
      line 195 of /lib/filterlib.php: call to filter_manager->apply_filter_chain()
      line 296 of /lib/filterlib.php: call to filter_manager->filter_text()
      line 1063 of /lib/weblib.php: call to performance_measuring_filter_manager->filter_text()
      line 72 of /blocks/html/block_html.php: call to format_text()
      line 280 of /blocks/moodleblock.class.php: call to block_html->get_content()
      line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      line 926 of /lib/blocklib.php: call to block_base->get_content_for_output()
      line 978 of /lib/blocklib.php: call to block_manager->create_block_contents()
      line 349 of /lib/blocklib.php: call to block_manager->ensure_content_created()
      line 4 of /theme/base/layout/frontpage.php: call to block_manager->region_has_content()
      line 685 of /lib/outputrenderers.php: call to include()
      line 637 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      line ? of unknownfile: call to core_renderer->header()
      line 1363 of /lib/setuplib.php: call to call_user_func_array()
      line ? of unknownfile: call to bootstrap_renderer->__call()
      line 91 of /index.php: call to bootstrap_renderer->header()

        Issue Links

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: