Plugin: LTI: Set replacement_user_id only when param is set - refs BT#18816

See de09dae298
pull/4114/head
Angel Fernando Quiroz Campos 4 years ago
parent 62923dec3d
commit 1068fced83
  1. 14
      plugin/ims_lti/configure.php

@ -60,9 +60,6 @@ switch ($action) {
->setCustomParams(
empty($formValues['custom_params']) ? null : $formValues['custom_params']
)
->setReplacementForUserId(
empty($formValues['replacement_user_id']) ? [] : $formValues['replacement_user_id']
)
->setDocumenTarget($formValues['document_target'])
->setCourse($course)
->setPrivacy(
@ -71,6 +68,10 @@ switch ($action) {
!empty($formValues['share_picture'])
);
if (!empty($formValues['replacement_user_id'])) {
$tool->setReplacementForUserId($formValues['replacement_user_id']);
}
if (!$baseTool) {
if (ImsLti::V_1P3 === $formValues['version']) {
$tool
@ -193,9 +194,6 @@ switch ($action) {
->setCustomParams(
empty($formValues['custom_params']) ? null : $formValues['custom_params']
)
->setReplacementForUserId(
empty($formValues['replacement_user_id']) ? [] : $formValues['replacement_user_id']
)
->setDocumenTarget($formValues['document_target'])
->setPrivacy(
!empty($formValues['share_name']),
@ -203,6 +201,10 @@ switch ($action) {
!empty($formValues['share_picture'])
);
if (!empty($formValues['replacement_user_id'])) {
$tool->setReplacementForUserId($formValues['replacement_user_id']);
}
if (null === $tool->getParent()) {
if ($tool->getVersion() === ImsLti::V_1P3) {
$tool

Loading…
Cancel
Save