You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default "Course Overview" template (in overview.yaml) includes an image with the URL /static/images/placeholder-faculty.png (which gets served from the LMS (?) - http://local.openedx.io:8000/static/images/placeholder-faculty.png).
Bug: clicking on the editor or making any changes will trigger replaceStaticWithAsset() and change this URL to a course-specific URL that doesn't actually exist, making the image broken:
Screen.Recording.2025-11-19.at.2.35.18.PM.mov
It appears that we allow "Studio URLs" like /static/uploaded_image.png to be in the Course Overview field, but as soon as you make any edits to the HTML, they will be rewritten to /asset-v1:Org+Course+Run+type@asset+block@uploaded_image.png which will work only as long as the course ID is not changed. * Bug: If the course is imported onto a different instance with a different course ID, this URL will no longer work. The HTML editor should not actually change the URL in the HTML, and keep it as /static/foo even if it is actually served from a different URL during editing/preview.
Because of replaceStaticWithAsset(), any course using either the default course overview template (1, above) or custom HTML with Studio URLs (2, above - /static/foo from "Files & Uploads") will have a bug.
Bug: "You've made some changes" will appear on such courses on the "Schedule & Details" page even if no changes have yet been made, because the URL rewriting has changed the HTML.
Test / Reproduction Instructions.
First, disable the replaceStaticWithAsset function so it just return false; immediately. This is just to allow you to make the changes in step 3 correctly.
Next, upload an image called "example.jpg" to a course, using the "Files & Uploads" page.
Finally, from the "Schedule & Details" page, use the "HTML" toolbar button to set the course's "Course Overview" HTML to the following (change the two BradenX+XBT+24 parts to the correct course ID!):
<sectionclass="about"><p>Here is an image from <code>overview.yaml</code>:</p><p><imgsrc="/static/images/placeholder-faculty.png" align="left" alt="Image #1" style="max-width: 200px;" /></p><p>Here is an image from the course, using Studio URL:</p><p><imgsrc="/static/example.jpg" align="left" alt="Image #2" style="max-width: 200px;" /></p><p>Here is an image from the course, using full web URL:</p><p><imgsrc="http://local.openedx.io:8000/asset-v1:BradenX+XBT+24+type@[email protected]" align="left" alt="Image #3" style="max-width: 200px;" /></p><p>Here is an image from the course, using partial web URL:</p><p><imgsrc="/asset-v1:BradenX+XBT+24+type@[email protected]" align="left" alt="Image #4" style="max-width: 200px;" /></p></section>
Restore the original replaceStaticWithAsset code.
Refresh the "Schedule & Details" page. Note that some images will be broken. To fix the bug, no images should be broken, and no "You've made some changes" should appear.
Notes
Make sure that any fixes here don't introduce regressions into the WYSIWYG editor / URL features used for problems and text components, in both courses and libraries.
overview.yaml) includes an image with the URL/static/images/placeholder-faculty.png(which gets served from the LMS (?) -http://local.openedx.io:8000/static/images/placeholder-faculty.png).replaceStaticWithAsset()and change this URL to a course-specific URL that doesn't actually exist, making the image broken:Screen.Recording.2025-11-19.at.2.35.18.PM.mov
/static/uploaded_image.pngto be in the Course Overview field, but as soon as you make any edits to the HTML, they will be rewritten to/asset-v1:Org+Course+Run+type@asset+block@uploaded_image.pngwhich will work only as long as the course ID is not changed. * Bug: If the course is imported onto a different instance with a different course ID, this URL will no longer work. The HTML editor should not actually change the URL in the HTML, and keep it as/static/fooeven if it is actually served from a different URL during editing/preview.replaceStaticWithAsset(), any course using either the default course overview template (1, above) or custom HTML with Studio URLs (2, above -/static/foofrom "Files & Uploads") will have a bug.Test / Reproduction Instructions.
replaceStaticWithAssetfunction so it justreturn false;immediately. This is just to allow you to make the changes in step 3 correctly.BradenX+XBT+24parts to the correct course ID!):replaceStaticWithAssetcode.Notes
Make sure that any fixes here don't introduce regressions into the WYSIWYG editor / URL features used for problems and text components, in both courses and libraries.