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

Error when try to update LTI type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.2, 2.4.5, 2.5.1
    • Fix Version/s: 2.4.6, 2.5.2
    • Labels:
    • Environment:
      Ubuntu Server 11.10 32 bits
      PHP : 5.3.6
      BD : Oracle 10.2.0.1.0
    • Database:
      Oracle
    • Testing Instructions:
      Hide

      Needs to be tested on Oracle/mssql. (As well as MySQL to ensure no regressions.)

      1. Log in as admin/teacher
      2. Navigate to a course
      3. Turn editing on
      4. Add an External tool activity
      5. Add a name for the activity
      6. Click the + next to External tool type
      7. Add the following details
      Tool name New tool type
      Tool Base URL http://www.imsglobal.org/developers/BLTI/tool.php
      Shared secret secret
      Consumer key 12345
      8. Save changes to the new type - you should be returned to the activity config
      9. Click Save and return to course
      10. Edit the activity
      11. Try to edit the new type (click the configuration icon next to the new type)
      12. VERIFY: the type can be edited correctly

      Repeat the same steps as an admin editing a global config tool.

      Show
      Needs to be tested on Oracle/mssql. (As well as MySQL to ensure no regressions.) 1. Log in as admin/teacher 2. Navigate to a course 3. Turn editing on 4. Add an External tool activity 5. Add a name for the activity 6. Click the + next to External tool type 7. Add the following details Tool name New tool type Tool Base URL http://www.imsglobal.org/developers/BLTI/tool.php Shared secret secret Consumer key 12345 8. Save changes to the new type - you should be returned to the activity config 9. Click Save and return to course 10. Edit the activity 11. Try to edit the new type (click the configuration icon next to the new type) 12. VERIFY: the type can be edited correctly Repeat the same steps as an admin editing a global config tool.
    • Workaround:
      Hide

      Problem :

      In file : ./mod/lti/locallib.php
      Function : lti_get_type_config()

      error in :
      $query = "SELECT name, value
      FROM

      {lti_types_config}
      WHERE typeid = :typeid1
      UNION ALL
      SELECT 'toolurl' AS name, baseurl AS value
      FROM {lti_types}
      WHERE id = :typeid2";

      solution :
      $query = "SELECT name, value
      FROM {lti_types_config}

      WHERE typeid = :typeid1
      UNION ALL
      SELECT 'toolurl' AS name, 'baseurl' AS value
      FROM

      {lti_types}

      WHERE id = :typeid2";

      Show
      Problem : In file : ./mod/lti/locallib.php Function : lti_get_type_config() error in : $query = "SELECT name, value FROM {lti_types_config} WHERE typeid = :typeid1 UNION ALL SELECT 'toolurl' AS name, baseurl AS value FROM {lti_types} WHERE id = :typeid2"; solution : $query = "SELECT name, value FROM {lti_types_config} WHERE typeid = :typeid1 UNION ALL SELECT 'toolurl' AS name, 'baseurl' AS value FROM {lti_types} WHERE id = :typeid2";
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When try to edit a LTI type, fails database and display an error.

      Replication steps:

      1. Log in as admin/teacher
      2. Navigate to a course
      3. Turn editing on
      4. Add an External tool activity
      5. Add a name for the activity
      6. Click the + next to External tool type
      7. Add the following details
        Tool name New tool type
        Tool Base URL http://www.imsglobal.org/developers/BLTI/tool.php
        Shared secret secret
        Consumer key 12345
      8. Save changes to the new type - you should be returned to the activity config
      9. Click Save and return to course
      10. Edit the activity
      11. Try to edit the new type (click the configuration icon next to the new type)

      Expected result: You should be able to edit the type configuration

      Actual result: An error is shown (Oracle only)

      External Tool Configuration
       
      Error reading from database
       
      More information about this error
      Debug info: ORA-01790: expression must have same datatype as corresponding expression
      SELECT name, value
      FROM m_lti_types_config
      WHERE typeid = :o_typeid1
      UNION ALL
      SELECT 'toolurl' AS name, baseurl AS value
      FROM m_lti_types
      WHERE id = :o_typeid2
      [array (
      'o_typeid1' => 1,
      'o_typeid2' => 1,
      )]
      Error code: dmlreadexception
      Stack trace:
       
          line 424 of \lib\dml\moodle_database.php: dml_read_exception thrown
          line 274 of \lib\dml\oci_native_moodle_database.php: call to moodle_database->query_end()
          line 1101 of \lib\dml\oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
          line 508 of \mod\lti\locallib.php: call to oci_native_moodle_database->get_records_sql()
          line 789 of \mod\lti\locallib.php: call to lti_get_type_config()
          line 124 of \mod\lti\instructor_edit_tool_type.php: call to lti_get_type_type_config()

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            jaume77 Jaume Rocarias
            Peer reviewer:
            Mark Nielsen
            Integrator:
            Dan Poltawski
            Tester:
            Damyon Wiese
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Sep/13