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

LTI: Custom parameters limited to 255 characters, use 'text' field with unlimited length

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MDL-57756-text-customparams-39
    • MDL-57756-text-customparams
    • Easy
    • Hide

      To Reproduce

      On a Fresh Install

      1. Create a LTI External tool
        1. You can use any dummy value, we just want to test the parameters can be saved
      2. Then enter into the custom parameters:

        custom_startdate=2017-01-24T10:46:00+00:00 
        custom_feedbackreleasedate=2017-01-25T10:46:00+00:00 
        custom_submit_papers_to=1 
        custom_late_accept_flag=0 
        custom_use_quoted_exclusion=0 
        custom_duedate=2017-01-25T10:46:00+00:00 
        custom_use_biblio_exclusion=0 
        custom_institutioncheck=1 
        custom_studentpapercheck=1 
        custom_journalcheck=1 
        custom_anonymous_marking_enabled=0 
        custom_internetcheck=1 
        custom_allow_non_or_submissions=0 
        custom_report_gen_speed=0 
        custom_s_view_reports=0
        

      3. Save and return to course, verify no errors occur
      4. Edit the LTI External Tool, verify all the custom parameters have been saved

      On Upgrade

      This test checks the upgrade is changing the type and preserving values entered before upgrade.

      1. On a version of Moodle without that fix (before the patch).
      2. Create a LTI External tool
      3. Enter in Custom Parameters: before=upgrade
      4. Save and Make sure no errors occur
      5. Upgrade to a version with this patch (after the patch)
      6. Navigate back to editing that LTI External tool and verify custom parameters preserved the value before=upgrade
      7. Replace the custom parameters with the values from the 1st test
      8. Save and verify no error occurs
      9. Edit the LTI External Tool, verify all the custom parameters have been saved
      Show
      To Reproduce On a Fresh Install Create a LTI External tool You can use any dummy value, we just want to test the parameters can be saved Then enter into the custom parameters: custom_startdate=2017-01-24T10:46:00+00:00 custom_feedbackreleasedate=2017-01-25T10:46:00+00:00 custom_submit_papers_to=1 custom_late_accept_flag=0 custom_use_quoted_exclusion=0 custom_duedate=2017-01-25T10:46:00+00:00 custom_use_biblio_exclusion=0 custom_institutioncheck=1 custom_studentpapercheck=1 custom_journalcheck=1 custom_anonymous_marking_enabled=0 custom_internetcheck=1 custom_allow_non_or_submissions=0 custom_report_gen_speed=0 custom_s_view_reports=0 Save and return to course, verify no errors occur Edit the LTI External Tool, verify all the custom parameters have been saved On Upgrade This test checks the upgrade is changing the type and preserving values entered before upgrade. On a version of Moodle without that fix (before the patch). Create a LTI External tool Enter in Custom Parameters: before=upgrade Save and Make sure no errors occur Upgrade to a version with this patch (after the patch) Navigate back to editing that LTI External tool and verify custom parameters preserved the value before=upgrade Replace the custom parameters with the values from the 1st test Save and verify no error occurs Edit the LTI External Tool, verify all the custom parameters have been saved

    Description

      The instructorcustomparameters field on the mdl32_lti is limited to 255 characters.
      This is causing issues with our content-item implementation. We have a number of custom parameters that we return to be launched with content item which total to more than 255 characters. We can't change the number of parameters we are returning, otherwise it somewhat defeats the point of content item.

      Debug information:

      Debug info: Data too long for column 'instructorcustomparameters' at row 1
      UPDATE mdl32_lti SET name = ?,showtitlelaunch = ?,typeid = ?,toolurl = ?,securetoolurl = ?,launchcontainer = ?,resourcekey = ?,password = ?,instructorcustomparameters = ?,icon = ?,secureicon = ?,instructorchoicesendname = ?,instructorchoicesendemailaddr = ?,instructorchoiceacceptgrades = ?,grade = ?,course = ?,intro = ?,introformat = ?,timemodified = ?,showdescriptionlaunch = ? WHERE id=?
      [array (
      0 => 'LTI-CI',
      1 => '1',
      2 => '1',
      3 => 'http://local.dev/api/lti/1p0/assignment?lang=en_us',
      4 => '',
      5 => '1',
      6 => '',
      7 => '',
      8 => 'custom_startdate=2017-01-24T10:46:00+00:00 
      custom_feedbackreleasedate=2017-01-25T10:46:00+00:00 
      custom_submit_papers_to=1 
      custom_late_accept_flag=0 
      custom_use_quoted_exclusion=0 
      custom_duedate=2017-01-25T10:46:00+00:00 
      custom_use_biblio_exclusion=0 
      custom_institutioncheck=1 
      custom_studentpapercheck=1 
      custom_journalcheck=1 
      custom_anonymous_marking_enabled=0 
      custom_internetcheck=1 
      custom_allow_non_or_submissions=0 
      custom_report_gen_speed=0 
      custom_s_view_reports=0',
      9 => '',
      10 => '',
      11 => '0',
      12 => '0',
      13 => 0,
      14 => 0,
      15 => '2',
      16 => '',
      17 => '1',
      18 => 1485254809,
      19 => 0,
      20 => '1',
      )]
      Error code: dmlwriteexception
       
       
      ×Stack trace:
      line 482 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 1406 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1438 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
      line 171 of /mod/lti/lib.php: call to mysqli_native_moodle_database->update_record()
      line 571 of /course/modlib.php: call to lti_update_instance()
      line 159 of /course/modedit.php: call to update_moduleinfo()
      

      To Reproduce
      The issue can be reproduced by creating a standard LTI External tool
      Then creating a course and a new assignment using the LTI external tool
      Then entering into the custom parameters:

      custom_startdate=2017-01-24T10:46:00+00:00 
      custom_feedbackreleasedate=2017-01-25T10:46:00+00:00 
      custom_submit_papers_to=1 
      custom_late_accept_flag=0 
      custom_use_quoted_exclusion=0 
      custom_duedate=2017-01-25T10:46:00+00:00 
      custom_use_biblio_exclusion=0 
      custom_institutioncheck=1 
      custom_studentpapercheck=1 
      custom_journalcheck=1 
      custom_anonymous_marking_enabled=0 
      custom_internetcheck=1 
      custom_allow_non_or_submissions=0 
      custom_report_gen_speed=0 
      custom_s_view_reports=0
      

      On attempting to create the assignment the creation will fail with a database error because the instructorcustomparameters filed is too long

      Attachments

        Activity

          People

            claudevervoort Claude Vervoort
            martinlenord Martin Lenord
            Jake Dallimore Jake Dallimore
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Jake Dallimore, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9/Nov/20

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 31 minutes
                2h 31m