fix: tinymce render outside of editors #1254
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This bug was introduced via #1208. The cause of this bug was that
state
has two different definitions when trying toTinyMceWidget
outside of the editors. One definition ofstate
was an empty object coming from the editors redux store. The second definition ofstate
had the required variables (images
,lmsEndpointUrl
,studioEndpointUrl
,learningContextId
, andisLibrary
). The former loaded last so component tried to render referencing an empty object.To fix the bug,
<TinyMceWidget />
was refactored to not use the redux store to fetchimages
,lmsEndpointUrl
,studioEndpointUrl
,learningContextId
orisLibrary
. Nowimages
,learningContextId
andisLibrary
are passed down from a parent component, andlmsEndpointUrl
andstudioEndpointUrl
referenced from the config value.This change impacts the Course Author
Before:
After:
Testing instructions
Updates testing
Schedule and details testing
Text editor testing
Problem editor testing