packbackbooks / lti-1-3-php-library

A library used for building IMS-certified LTI 1.3 tool providers in PHP.
Apache License 2.0
39 stars 25 forks source link

Fix a PHP warning when optional 'data' property of deep link settings is not present in message launch. #45

Closed mattwright closed 2 years ago

mattwright commented 2 years ago

Summary of Changes

Resolves a PHP warning that was noted in issue https://github.com/packbackbooks/lti-1-3-php-library/issues/43

Per specs at https://www.imsglobal.org/spec/lti-dl/v2p0/#deep-linking-settings the 'data' property of deep link settings is optional. In the scenario where this field was not sent by the platform (tested on Canvas) a PHP warning would be thrown:

PHP message: PHP Notice: Undefined index: data in /.../vendor/packbackbooks/lti-1p3-tool/src/LtiDeepLink.php on line 33

This change ensures that the 'data' property in the deep link response is only returned if it was sent by the platform.

Testing

Tested manually on Canvas