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.
This commit is contained in:
Rômulo Penido
2024-11-15 14:54:56 -03:00
committed by GitHub
parent 7adecb4c6c
commit cb1e6eeb3f

View File

@@ -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');