diff --git a/manifest.php b/manifest.php index 50686aaa..6f4d1b49 100755 --- a/manifest.php +++ b/manifest.php @@ -35,7 +35,7 @@ 'label' => 'LTI library', 'description' => 'TAO LTI library and helpers', 'license' => 'GPL-2.0', - 'version' => '3.0.0', + 'version' => '3.1.0', 'author' => 'Open Assessment Technologies SA', 'requires' => array( 'tao' => '>=9.0.0' diff --git a/models/classes/LtiVariableMissingException.php b/models/classes/LtiVariableMissingException.php new file mode 100644 index 00000000..9fe64263 --- /dev/null +++ b/models/classes/LtiVariableMissingException.php @@ -0,0 +1,35 @@ +variables[$key])) { return $this->variables[$key]; } else { - throw new taoLti_models_classes_LtiException('Undefined LTI variable '.$key, LtiErrorMessage::ERROR_MISSING_PARAMETER); + throw new LtiVariableMissingException($key); } } diff --git a/models/classes/class.LtiUser.php b/models/classes/class.LtiUser.php index 56449025..c559bdcb 100755 --- a/models/classes/class.LtiUser.php +++ b/models/classes/class.LtiUser.php @@ -1,4 +1,5 @@ roles; break; case PROPERTY_USER_FIRSTNAME : - $returnValue = [$this->getLaunchData()->getUserGivenName()]; + try { + $returnValue = [$this->getLaunchData()->getUserGivenName()]; + } catch (LtiVariableMissingException $e) { + $returnValue = ''; + } break; case PROPERTY_USER_LASTNAME : - $returnValue = [$this->getLaunchData()->getUserFamilyName()]; + try { + $returnValue = [$this->getLaunchData()->getUserFamilyName()]; + } catch (LtiVariableMissingException $e) { + $returnValue = ''; + } break; default: common_Logger::d('Unkown property '.$property.' requested from '.__CLASS__); diff --git a/scripts/update/class.Updater.php b/scripts/update/class.Updater.php index c776d48c..0d1b1e29 100644 --- a/scripts/update/class.Updater.php +++ b/scripts/update/class.Updater.php @@ -73,6 +73,6 @@ public function update($initialVersion) $this->setVersion('2.1.0'); } - $this->skip('2.1.0', '3.0.0'); + $this->skip('2.1.0', '3.1.0'); } }