From cb1e6eeb3fddc446fca487017d042641c69f285d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Fri, 15 Nov 2024 14:54:56 -0300 Subject: [PATCH] fix: error while loading iframe on mfe Unit Outline [FC-0062] (#35828) On the Course unit page after merging the PR with new iframe for xblocks, an issue with infinite loading of the iframe appeared if the unit/xblock has tags. This PR solves the problem with the error that appeared. Addition and processing of the tagging functionality is planned in future PRs. --- cms/static/js/views/pages/container_subviews.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cms/static/js/views/pages/container_subviews.js b/cms/static/js/views/pages/container_subviews.js index b32c86ae8d..cfb47c7cd8 100644 --- a/cms/static/js/views/pages/container_subviews.js +++ b/cms/static/js/views/pages/container_subviews.js @@ -506,9 +506,13 @@ function($, _, gettext, BaseView, ViewUtils, XBlockViewUtils, MoveXBlockUtils, H }, renderTagElements: function(tags, depth, parentId) { + /* This function displays the tags in the sidebar of the legacy Unit Outline Page. + * It is not used when the Authoring MFE iframes a component in the Unit Outline. */ + const parentElement = document.querySelector(`.content-tags-${parentId}`); + if (!parentElement) return; + const tagListElement = this; tags.forEach(function(tag) { - const parentElement = document.querySelector(`.content-tags-${parentId}`); var tagContentElement = document.createElement('div'), tagValueElement = document.createElement('span');