diff --git a/lib/lti1p3/readme_moodle.txt b/lib/lti1p3/readme_moodle.txt index ddb6b0778b4..d92c09b1cb6 100644 --- a/lib/lti1p3/readme_moodle.txt +++ b/lib/lti1p3/readme_moodle.txt @@ -2,6 +2,7 @@ LTI 1.3 Tool Library import instructions This library is a patched for use in Moodle - it requires the following changes be applied on top of the packback upstream base: 1. Removal of phpseclib dependency (replaces a single call with openssl equivalent) +2. The fix included in MDL-87789, ensuring optional lineitem properties are omitted if not set. To upgrade to a new version of this library: 1. Clone the latest version of the upstream library from github: diff --git a/lib/lti1p3/src/DeepLinkResources/Resource.php b/lib/lti1p3/src/DeepLinkResources/Resource.php index 5cbb4b2be9a..ecfbac6bdff 100644 --- a/lib/lti1p3/src/DeepLinkResources/Resource.php +++ b/lib/lti1p3/src/DeepLinkResources/Resource.php @@ -50,7 +50,7 @@ class Resource if (isset($this->line_item)) { $resource['lineItem'] = [ 'scoreMaximum' => $this->line_item->getScoreMaximum(), - 'label' => $this->line_item->getLabel(), + ...(!is_null($this->line_item->getLabel()) ? ['label' => $this->line_item->getLabel()] : []), ]; }