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

Error thrown in filebrowser/file_info_context_course.php in postgresql 8.3

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.9, 2.3.3
    • Fix Version/s: 2.3.4, 2.4.1
    • Component/s: Filepicker
    • Labels:

      Description

      We encountered the following error in our logs:

      <2012-12-20 14:27:15 JST moodle moodle2012 6371>DETAIL: parameters: $1 = '5474', $2 = '51802', $3 = 'course', $4 = 'section', $5 = '.'
      <2012-12-20 14:27:15 JST moodle moodle2012 6371>: syntax error at or near "sectionid" at character 23
      <2012-12-20 14:27:15 JST moodle moodle2012 6371>STATEMENT: SELECT DISTINCT cs.id sectionid FROM mdl_files f, mdl_course_sections cs
      WHERE cs.course = $1
      AND f.contextid = $2
      AND f.component = $3
      AND f.filearea = $4
      AND f.itemid = cs.id
      AND f.filename <> $5

      Apparently "SELECT DISTINCT cs.id sectionid " should be "SELECT DISTINCT cs.id section". At least with this modification, the error goes away. The error was discovered in v. 2.1.9 but appears to still be present in 2.3.3.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            skodak Petr Skoda added a comment -

            Thanks for the report.

            Show
            skodak Petr Skoda added a comment - Thanks for the report.
            Hide
            poltawski Dan Poltawski added a comment -

            Petr, please can you give me some idea of how to test it? This will have been breaking oracle too.

            Show
            poltawski Dan Poltawski added a comment - Petr, please can you give me some idea of how to test it? This will have been breaking oracle too.
            Hide
            skodak Petr Skoda added a comment -

            No idea how to test it, I am no file API/repository expert, the bug seems obvious.

            Show
            skodak Petr Skoda added a comment - No idea how to test it, I am no file API/repository expert, the bug seems obvious.
            Hide
            poltawski Dan Poltawski added a comment -

            I've added a basic regression test.

            Show
            poltawski Dan Poltawski added a comment - I've added a basic regression test.
            Hide
            markn Mark Nelson added a comment -

            Works as expected. Passing.

            Show
            markn Mark Nelson added a comment - Works as expected. Passing.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            And your fantastic code has met core, hope they become good friends for a long period.

            Closing, thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - And your fantastic code has met core, hope they become good friends for a long period. Closing, thanks!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jan/13