-
Notifications
You must be signed in to change notification settings - Fork 219
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: skip setting fields that are not in scope_mappings [FC-0076] #815
base: master
Are you sure you want to change the base?
fix: skip setting fields that are not in scope_mappings [FC-0076] #815
Conversation
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.
|
e1c857c
to
a064796
Compare
a064796
to
e0df689
Compare
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.
👍 Fixes the issue, thanks @rpenido !
- I tested this on my tutor dev stack in conjunction with fix: advanced editor styling on library authoring [FC-0076] edx-platform#36146, by saving changes to the Survey & Poll XBlocks
- I read through the code
-
I checked for accessibility issuesN/A - Includes documentation - inline code comment explaining the change
-
User-facing strings are extracted for translationN/A
@@ -687,7 +687,7 @@ class XBlock(Plugin, Blocklike, metaclass=_HasChildrenMetaclass): | |||
|
|||
# These are dynamically managed by the awful hackery of _HasChildrenMetaclass. | |||
# We just declare their types here to make static analyzers happy. | |||
# Note that children is only defined iff has_children is defined and True. | |||
# Note that children is only defined if has_children is defined and True. |
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.
nit: this comment change can be reverted -- iff is a shorthand term for "if and only if"
Description
This PR adds a check to the
set_many
function to ignore the_field_data
from scopes that are not loaded.Context
This fixes an error on the meilisearch index update after saving the
Survey
Xblock.The underlying issue is that the
_get_fields_to_save()
returns thechoices
field from theuser_state
scope.As the
LearningCoreXBlockRuntime
doesn't have theScope.user_state
, theget_block
function throws an error.We should also investigate why we are getting the
choices
field on_get_fields_to_save()
response, but for the sake of robustness, I think it would also worth it to ignoreScope.user_state
fields here.Testing instructions
Survey
block on the Library Authoring page and check the error abovePrivate ref: FAL-4033