Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport] fix: render library v2 assets with whitespace (#35974) #36060

Conversation

DanielVZ96
Copy link
Contributor

Assets that contain whitespace fail to be rendered when uploaded to library v2

Description

Assets that contain whitespace fail to be rendered when uploaded to library v2.
Backport of: #35974

Deadline

ASAP

Assets that contain whitespace fail to be rendered when uploaded to library v2
@openedx-webhooks
Copy link

openedx-webhooks commented Dec 26, 2024

Thanks for the pull request, @DanielVZ96!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Dec 26, 2024
@DanielVZ96 DanielVZ96 added create-sandbox open-craft-grove should create a sandbox environment from this PR and removed open-source-contribution PR author is not from Axim or 2U labels Dec 26, 2024
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Dec 26, 2024
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@mphilbrick211 mphilbrick211 added backport PR backports a change from main to a named release. needs reviewer assigned PR needs to be (re-)assigned a new reviewer labels Dec 27, 2024
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@ChrisChV
Copy link
Contributor

ChrisChV commented Jan 8, 2025

@DanielVZ96 I tested this in my local and I got this error. Can you check if it's not just me? CC @bradenmacdonald

image

@bradenmacdonald
Copy link
Contributor

@ChrisChV @DanielVZ96 I'm having a different issue - the image asset is working just fine, on sumac.master, without this fix. Can you please provide further testing instructions or how to reproduce?

Screenshot of uploaded asset file

Screenshot 2025-01-13 at 10 55 44 AM

@DanielVZ96
Copy link
Contributor Author

@bradenmacdonald I got the same error as @ChrisChV

image

for some reason the edx-platform sumac.master branch is missing this endpoint.

https://github.com/openedx/edx-platform/blob/master/cms/djangoapps/contentstore/rest_api/v1/views/course_waffle_flags.py

also in order to test this PR you need to use the text editor file upload feature to upload the images and test that they render correctly. but it seems like the text editor no longer has that functionality or it needs to be activated somehow.

@bradenmacdonald
Copy link
Contributor

also in order to test this PR you need to use the text editor file upload feature to upload the images and test that they render correctly. but it seems like the text editor no longer has that functionality or it needs to be activated somehow.

It was never backported to Sumac, so that feature doesn't currently exist. Can you not test the bug using the "Advanced" file upload, which is what I showed in my screenshot? If the bug only affects the visual editor and not regular library asset uploads in general, then we don't need to backport it for now.

@bradenmacdonald
Copy link
Contributor

for some reason the edx-platform sumac.master branch is missing this endpoint.

https://github.com/openedx/edx-platform/blob/master/cms/djangoapps/contentstore/rest_api/v1/views/course_waffle_flags.py

Yes, that endpoint was added after The Sumac release was cut. Perhaps you are using the wrong branch of frontend-app-authoring then, because the corresponding code is not in the sumac.master branch of the Authoring MFE either.

@bradenmacdonald
Copy link
Contributor

But if the bug only affects the text editor file upload feature, and assets with a space in their name work perfectly well otherwise, then why are we fixing it in edx-platform? It sounds like it's a bug in the frontend editor in that case.

@DanielVZ96
Copy link
Contributor Author

@bradenmacdonald testing edx-platform sumac.master with frontend-app-authoring sumac.master the assets with whitespace aren't loading for me in the cms

@bradenmacdonald
Copy link
Contributor

@DanielVZ96 Can you show me a screenshot and specific testing instructions?

@DanielVZ96
Copy link
Contributor Author

DanielVZ96 commented Jan 14, 2025

@bradenmacdonald here's a video:

  1. create a text library component
  2. upload an image in the advanced tab
  3. add it to the component html
  4. check it in the cms and it will be broken
    (because it's looking for the same image but with the whitespace replaced by underscores becase that was the old behaviour. this is because the MFE uses a diferent endpoint for image uploading)

https://www.loom.com/share/2e64c23b2e07457caa51e11580c6dc7d?sid=c8765bdd-73c0-494c-a4ee-bd456a56a87e

I also tested with this PR's code and it's still failing with the advanced image upload, but with the new mfe editor image upload (i was able to find it through studio), it works correctly:

https://www.loom.com/share/21945849fa4345c6b100c0ff4d80abda?sid=19a4b424-678c-4e26-8863-40cee9919492

@bradenmacdonald
Copy link
Contributor

I think we can close this for now and consider fixing it as part of backporting openedx/modular-learning#246 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport PR backports a change from main to a named release. create-sandbox open-craft-grove should create a sandbox environment from this PR needs reviewer assigned PR needs to be (re-)assigned a new reviewer open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants