-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix: return items in _get_render_metadata without validate prereq_met #36243
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @jignaciopm! 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. 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
99e45da
to
ddaeeba
Compare
hello @tecoholic and @viadanna, I asked a review from you guys as you where the last people to modify the line. It looks like the MFE view is breaking the whole navigation history due to the |
@felipemontoya I just seem to have renamed it from items to blocks. @viadanna, I think you might be better suited to evaluate the changes. |
@@ -557,10 +557,8 @@ def _get_render_metadata(self, context, children, prereq_met, prereq_meta_info, | |||
'This section is a prerequisite. You must complete this section in order to unlock additional content.' | |||
) | |||
|
|||
blocks = self._render_student_view_for_blocks(context, children, fragment, view) if prereq_met else [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felipemontoya The prereq_met
bit has been in place since 2018 and was used to make sure the courseware didn't render blocks in gated content when the prerequisites aren't met.
Given the issue is new due to the migration to the MFE, are we sure we want to fix this by changing the behavior of the API? Shouldn't we fix this in the MFE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @viadanna
I understand. The problem is that I tried different ways from the MFE and I couldn't find a way to solve it because not having the unit of that section, which is a prerequisite, everything gets out of order at the route level because I don't have an identifier to reference in the route.
I understand that it is something that has been around since 2018 but since MFE is something new, perhaps the backend should have been adapted in that place so that it did not break MFE.
For more details on how I arrived at this solution you can see it here openedx/frontend-app-learning#1546 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jignaciopm Oh, I see, it's not an old bug, but the MFE requires an API behavior change. I'm worried that this would leak information to the client, as it would return the xblocks even when the content is gated. Can it gather just the blocks necessary for the MFE to work instead?
Description
This PR finds a solution to the problem reported in openedx/frontend-app-learning#1546
The endpoint
{{domain}}/api/courseware/sequence/{{sequenceId}}
was not returning the units (items) when the section (sequence) had a prerequisite.Before:
391659904-65c09750-21c9-47d2-b4db-ad37ee1c0ac3.webm
After:
https://github.com/user-attachments/assets/c0864e2d-2ab0-4aa0-bbac-c94f31c35ba5
Supporting information
openedx/frontend-app-learning#1546
Testing instructions