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

Enrol LTI never falls back to Context-Level NRPS requests

XMLWordPrintable

      The LTI 1.3 Sync_Members task in enrol_lti never runs in context-level mode, since the contextmembershipurl property on the nrps_info task is overwritten before the method is run.

      This is so in PHP 7.4, at least, and was an unexpected result.

      A working fix is for get_context_memberships_url() in /enrol/lti/classes/local/ltiadvantage/entity/nrps_info.php to return a clone of that property instead of the property itself.

      To reproduce:
      Publish a resource from a course in Moodle T, the Tool, add it as an external tool on Moodle P, the Platform; then delete it on the platform so that the resource link is no longer valid.

      Sync members should then catch a 400 error when making the NPRS call in get_resource_link_level_members and fall back to get_context_level_members.

      However, $nrps->get_context_memberships_url()->out(false) will resolve to the NRPS url with the rlid parameter from the resource-link level request attempt included, and so it, too, results in the same 400 exception, caught in the main function, execute.

            liammoran Liam Moran
            liammoran Liam Moran
            Jake Dallimore Jake Dallimore
            Safat Shahin Safat Shahin
            CiBoT CiBoT
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 34 minutes
                1h 34m

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