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

Undefined index error in tool_launch service when only 'lineitem' property is present

    XMLWordPrintable

Details

    • 3
    • 4.1 holding pattern 2

    Description

      We're trying to integrate with a client that has Moodle acting as a Tool.

      While sending the 'id_token', we only send a 'lineitem' property without the 'lineitems' (plural) property, since we only support sending scores to a single resource.

       

      When launching we are getting the following error:

      Notice: Undefined index: lineitems in /var/www/*******/public_html/enrol/lti/classes/local/ltiadvantage/service/tool_launch_service.php on line 166

       

      Upon inspecting this piece of code, it seems to be getting the 'lineitem' only when the plural 'lineitems' is present:

       

              // AGS. If the lineitemsurl is missing, it means the tool has no access to the endpoint.
              // See: http://www.imsglobal.org/spec/lti-ags/v2p0#assignment-and-grade-service-claim.
              if ($launchdata->ags && $launchdata->ags['lineitems']) {
                  $resourcelink->add_grade_service(
                      new \moodle_url($launchdata->ags['lineitems']),
                      isset($launchdata->ags['lineitem']) ? new \moodle_url($launchdata->ags['lineitem']) : null,
                      $launchdata->ags['scope']
                  );
              }

       

      According to the spec, the plural 'lineitems' is optional.
      What baffles me is that this piece of code has a comment with a link to the IMS spec, which literally has an example without the plural 'lineitems':
       

      I assume this is a bug? This is preventing us from completing our integration with this client.

      Attachments

        Issue Links

          Activity

            People

              jaked Jake Dallimore
              kuret Kuret
              Mihail Geshoski Mihail Geshoski
              Ilya Tregubov Ilya Tregubov
              CiBoT CiBoT
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours, 30 minutes
                  5h 30m

                  Clockify

                    Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.