From 3382df5406209d8522344c8f6832d714fe4b583b Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Thu, 29 Jan 2026 13:13:59 +0800 Subject: [PATCH] MDL-87789 libraries: patch lti1p3 for certification support https://github.com/packbackbooks/lti-1-3-php-library/issues/169 blocks us from using the new build.1edtech certification tooling. This issue commits that fix as a library customisation/hack for stables, so the suite can be used for annual/bi-annual re-certification. --- public/lib/lti1p3/readme_moodle.txt | 1 + public/lib/lti1p3/src/DeepLinkResources/Resource.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/lib/lti1p3/readme_moodle.txt b/public/lib/lti1p3/readme_moodle.txt index ddb6b0778b4..d92c09b1cb6 100644 --- a/public/lib/lti1p3/readme_moodle.txt +++ b/public/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/public/lib/lti1p3/src/DeepLinkResources/Resource.php b/public/lib/lti1p3/src/DeepLinkResources/Resource.php index 5cbb4b2be9a..ecfbac6bdff 100644 --- a/public/lib/lti1p3/src/DeepLinkResources/Resource.php +++ b/public/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()] : []), ]; }