Moodle
  1. Moodle
  2. MDL-26348

Oracle error on the language editing page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2, 2.3.2, 2.4
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Administration
    • Labels:
    • Environment:
      Moodle 2.0.1
      DB Oracle 11.2.0.2.0
      PHP 5.3.2
      Apache 2.0 Handler
    • Database:
      Oracle
    • Testing Instructions:
      Hide
      1. Test under Oracle + any other DB.
      2. Log in as an admin
      3. Browse to Settings > Language > Language customisations.
      4. Choose a language.
      5. Open the language pack for editing (may take some time).
      6. Select a lang file and click "Show strings"
      7. Make sure the page loads.
      Show
      Test under Oracle + any other DB. Log in as an admin Browse to Settings > Language > Language customisations. Choose a language. Open the language pack for editing (may take some time). Select a lang file and click "Show strings" Make sure the page loads.
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull Master Branch:
      wip-MDL-26348-m24
    • Rank:
      15943

      Description

      Debug info: ORA-00918: column ambiguously defined
      SELECT s.id, s.*, c.name AS component FROM m_report_customlang_components c
      JOIN m_report_customlang s ON s.componentid = c.id
      WHERE s.lang = :lang
      AND c.name = :param0000 AND LOWER(s.stringid) NOT LIKE LOWER(:link) ESCAPE '\' ORDER BY c.name, s.stringid
      [array (
      'lang' => 'es',
      'param0000' => 'core',
      'link' => '%
      _link',
      'oracle_num_rows' => 100,
      )]
      Stack trace:

      • line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
      • line 268 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
      • line 1042 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
      • line 512 of /admin/report/customlang/locallib.php: call to oci_native_moodle_database->get_records_sql()
      • line 115 of /admin/report/customlang/edit.php: call to report_customlang_translator->__construct()

        Issue Links

          Activity

          Hide
          Dan Poltawski added a comment -

          Verified this on 2.2:

          Debug info: ORA-00918: column ambiguously defined
          SELECT *
          FROM (SELECT s.id, s.*, c.name AS component FROM m_tool_customlang_components c
          JOIN m_tool_customlang s ON s.componentid = c.id
          WHERE s.lang = :o_lang
          AND c.name = :o_param1 AND LOWER(s.stringid) NOT LIKE LOWER(:o_link) ESCAPE '\' ORDER BY c.name, s.stringid)
          WHERE rownum <= :o_oracle_num_rows
          [array (
          'o_lang' => 'en',
          'o_param1' => 'core_auth',
          'o_link' => '%
          _link',
          'o_oracle_num_rows' => 100,
          )]

          Stack trace: •line 394 of \lib\dml\moodle_database.php: dml_read_exception thrown
          •line 268 of \lib\dml\oci_native_moodle_database.php: call to moodle_database->query_end()
          •line 1096 of \lib\dml\oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
          •line 532 of \admin\tool\customlang\locallib.php: call to oci_native_moodle_database->get_records_sql()
          •line 114 of \admin\tool\customlang\edit.php: call to tool_customlang_translator->__construct()

          Show
          Dan Poltawski added a comment - Verified this on 2.2: Debug info: ORA-00918: column ambiguously defined SELECT * FROM (SELECT s.id, s.*, c.name AS component FROM m_tool_customlang_components c JOIN m_tool_customlang s ON s.componentid = c.id WHERE s.lang = :o_lang AND c.name = :o_param1 AND LOWER(s.stringid) NOT LIKE LOWER(:o_link) ESCAPE '\' ORDER BY c.name, s.stringid) WHERE rownum <= :o_oracle_num_rows [array ( 'o_lang' => 'en', 'o_param1' => 'core_auth', 'o_link' => '% _link', 'o_oracle_num_rows' => 100, )] Stack trace: •line 394 of \lib\dml\moodle_database.php: dml_read_exception thrown •line 268 of \lib\dml\oci_native_moodle_database.php: call to moodle_database->query_end() •line 1096 of \lib\dml\oci_native_moodle_database.php: call to oci_native_moodle_database->query_end() •line 532 of \admin\tool\customlang\locallib.php: call to oci_native_moodle_database->get_records_sql() •line 114 of \admin\tool\customlang\edit.php: call to tool_customlang_translator->__construct()
          Hide
          Helder Pereira added a comment -

          Hello. Is this bug being addressed?
          This Oracle problems are being a show stopper on my company to adopt Moodle.
          I already made the workaround on the same problem that the Basic Grade Report had. It was also a ORA-00918.
          I know it's not Moodle fault, but Oracle is the database many companies use, so it's important too.
          Anyone has a solution or workaround for this?
          Thank you.

          Show
          Helder Pereira added a comment - Hello. Is this bug being addressed? This Oracle problems are being a show stopper on my company to adopt Moodle. I already made the workaround on the same problem that the Basic Grade Report had. It was also a ORA-00918. I know it's not Moodle fault, but Oracle is the database many companies use, so it's important too. Anyone has a solution or workaround for this? Thank you.
          Hide
          Sam Hemelryk added a comment -

          Putting a solution up for peer-review now.
          Pretty simple issue and solution, having s.id, s.* in the select is redundant and causing the noted duplication.

          Show
          Sam Hemelryk added a comment - Putting a solution up for peer-review now. Pretty simple issue and solution, having s.id, s.* in the select is redundant and causing the noted duplication.
          Hide
          Helder Pereira added a comment - - edited

          Great! If it is simple, and has a simple solution, could you share how to do it?

          Thank you.

          Show
          Helder Pereira added a comment - - edited Great! If it is simple, and has a simple solution, could you share how to do it? Thank you.
          Hide
          Sam Hemelryk added a comment -

          Hi Helder,

          The changes can be found in the details at the top of this issue.
          The change is identical in all versions so check out https://github.com/samhemelryk/moodle/compare/master...wip-MDL-26348-m24.
          Once this has been peer-reviewed we can put it up for inclusion into Moodle's code and hopefully next week this change will land to all branches, and the next future release will be fixed.

          Many thanks
          Sam

          Show
          Sam Hemelryk added a comment - Hi Helder, The changes can be found in the details at the top of this issue. The change is identical in all versions so check out https://github.com/samhemelryk/moodle/compare/master...wip-MDL-26348-m24 . Once this has been peer-reviewed we can put it up for inclusion into Moodle's code and hopefully next week this change will land to all branches, and the next future release will be fixed. Many thanks Sam
          Hide
          Sam Hemelryk added a comment -

          Submitting for integration review, I've tested this thoroughly and it is a small change and as such I'm confident with this fix.

          Show
          Sam Hemelryk added a comment - Submitting for integration review, I've tested this thoroughly and it is a small change and as such I'm confident with this fix.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated (22, 23 & master), thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated (22, 23 & master), thanks!
          Hide
          Helder Pereira added a comment -

          Thank you very much, already tested it, and work fine on Oracle.

          Many thanks

          Show
          Helder Pereira added a comment - Thank you very much, already tested it, and work fine on Oracle. Many thanks
          Hide
          Rajesh Taneja added a comment -

          Thanks Sam,
          Works great. Tested on pgsql, mysql and oracle.

          Show
          Rajesh Taneja added a comment - Thanks Sam, Works great. Tested on pgsql, mysql and oracle.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          From somewhere within the clouds...

          Congrats, this has been sent upstream and is now part of Moodle (your favorite LMS platform). Many thanks for your awesome collaboration!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - From somewhere within the clouds... Congrats, this has been sent upstream and is now part of Moodle (your favorite LMS platform). Many thanks for your awesome collaboration! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: