From 26d0ac156eb346a9409b7e0c3dd3d7703c3a104d Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Thu, 21 Sep 2023 15:15:26 +0800 Subject: [PATCH] MDL-79442 mod_lti: launch container should inherit from tool config Specifically in the case where multiple content items are returned, and when we hit the content_item_to_form() method, ensure that content-item- specific values do not influence the final value of launchcontainer, which must use the value set in tool configuration. --- mod/lti/locallib.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mod/lti/locallib.php b/mod/lti/locallib.php index fe85f4d9134..d17f7111042 100644 --- a/mod/lti/locallib.php +++ b/mod/lti/locallib.php @@ -1508,16 +1508,10 @@ function content_item_to_form(object $tool, object $typeconfig, object $item) : } $config->instructorchoicesendname = LTI_SETTING_NEVER; $config->instructorchoicesendemailaddr = LTI_SETTING_NEVER; + + // Since 4.3, the launch container is dictated by the value set in tool configuration and isn't controllable by content items. $config->launchcontainer = LTI_LAUNCH_CONTAINER_DEFAULT; - if (isset($item->placementAdvice->presentationDocumentTarget)) { - if ($item->placementAdvice->presentationDocumentTarget === 'window') { - $config->launchcontainer = LTI_LAUNCH_CONTAINER_WINDOW; - } else if ($item->placementAdvice->presentationDocumentTarget === 'frame') { - $config->launchcontainer = LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS; - } else if ($item->placementAdvice->presentationDocumentTarget === 'iframe') { - $config->launchcontainer = LTI_LAUNCH_CONTAINER_EMBED; - } - } + if (isset($item->custom)) { $config->instructorcustomparameters = params_to_string($item->custom); }