"Web" button URL copied from Files&Uploads not working in ORAs

Description

If partners use the "Web" button link to get the URL of an uploaded file in the "Files&Uploads" section in Studio and then try to use it in an ORA, the URL won't work.

For example, if the link copied is courses.edx.org/asset-v1:ASUx+SCM587+1T2021+type@asset+block@Intro_to_Task_Bias_Exercise.docx, when inserted in an ORA, ORA will automatically convert it to https://studio.edx.org/container/courses.edx.org/asset-v1:ASUx+SCM587+1T2021+type@asset+block@Intro_to_Task_Bias_Exercise.docx, making both Static and Web URLs not working

We have found a workaround solution, which is to add "https://" in front of the URL copied by "Web". Could these be added so that the button gives the full URL automatically? (link to ORA which might have been fixed with the workaround: https://studio.edx.org/container/block-v1:ASUx+SCM587+1T2021+type@vertical+block@46247bc510da486cbbcd18d7b3bc50af#)

Steps to Reproduce

None

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Activity

Show:
Nathan Sprenkle
April 2, 2021, 7:36 PM

Have verified in PROD

Nathan Sprenkle
April 1, 2021, 5:51 PM

, have created a PR which should fix this:

Nathan Sprenkle
April 1, 2021, 4:07 PM

, I want to check that I have the workflow correct from this comment. Do you believe the fix of just adding the https:// before the URL sufficiently fixes the workflow?

Nathan Sprenkle
March 31, 2021, 9:23 PM

Proposed patch (adds protocol before external link):

Nathan Sprenkle
March 31, 2021, 8:59 PM

Updated workflow/problem definition from playing around in stage:

  1. Go to Studio > Content > Files & Uploads

  2. Find an asset, click “Web” button (returns something like: courses.stage.edx.org/asset-v1:Foo+TT101+R0+type@asset+block@time-travel1.jpg)

  3. Go to ORA prompt editor and edit, click “image” button to add an image.

  4. Paste copied URL into the “Source” field

  5. Note that the image doesn’t show up in the preview

  6. Adding https:// before the URL fixes the image use in ORA

Proposed fixes. Either:

  • Update “Web” button to include https:// protocol info
    hint: edx-platform/cms/djangoapps/contentstore/views/assets.py::_get_asset_json()

  • Auto-include/handle lack of protocol tag in ORA (much harder)

Done

Assignee

Nathan Sprenkle

Reporter

Alfredo Guillem

Reach

Group(s)

Impact

None

Platform Area

None

Customer

None

Partner Manager

None

URL

None

Contributor Name

None

Groups with Read-Only Access

None

Story Points

2

Actual Points

None

Category of Work

None

Platform Map Area (Levels 1 & 2)

Educator Experiences - Course Authoring Experience

Platform Map Area (Levels 3 & 4)

Core Course Content Blocks - Open Response Assessments

Sprint

None

Priority

CAT-3