Conversation
…issing The clipboard holds a *copy* of a block, so its XBlock plugin may no longer be installed (e.g. a custom XBlock was removed from the platform). StagedContentSerializer.get_block_type_display() called xblock_type_display_name(), which raises PluginMissingError in that case, so reading the clipboard raised, and because the clipboard is embedded in the course index response (initial_user_clipboard), the whole course index request 500s -- for every course, for any user who happens to have such a clipboard. The same applies to the /api/content-staging/v1/clipboard/ endpoint, and there is no API to discard the stale clipboard, so authors get stuck. Fall back to the raw block type, mirroring openedx.core.djangoapps.xblock.api.xblock_type_display_name, which already handles a missing plugin this way.
|
Thanks for the pull request, @rpenido! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
samuelallan72
left a comment
There was a problem hiding this comment.
@rpenido 👍 nice catch, works for me :)
- I tested this: followed the test instructions
- I read through the code
- I checked for accessibility issues
- Includes documentation
|
Hi @bradenmacdonald! Could you review this when you have some time? |
|
@rpenido Yep! I'll review when I can. |
Description
StagedContentSerializer.get_block_type_displayraisedPluginMissingErrorwhen the XBlock for the staged content's block type is not installed, so reading the clipboard failed. Because the clipboard is embedded in the course index response (initial_user_clipboard), that madeGET /api/contentstore/v1/course_index/<course_key>return 500 for every course the user could open, and/api/content-staging/v1/clipboard/failed as well — with no API to discard the stale clipboard, the author is stuck.The clipboard keeps a copy of a block, so the plugin can be removed from the platform after the copy was made (e.g. an operator drops a custom XBlock, or the platform is upgraded and a third-party block goes away).
The fix falls back to the raw block type, which is what
openedx.core.djangoapps.xblock.api.xblock_type_display_namealready does for v2 libraries:Impacted roles: Course Author
Supporting information
Testing instructions
Before this change, the course index API returns 500; and the course will not render.
Checking out this branch and the course will render.
Deadline
None.
Other information
None.
Private ref: FAL-4394