Gracefully handles excluded fields from attributes during serialization on JsonCache
requested to merge 59208-fix-error-500-on-every-page-when-active-broadcast-message-present-after-upgrading-to-11-9-0 into master
What does this MR do?
We have models that leave out some fields from the JSON export for security reasons, e.g. the BroadcastMessage model that include the CacheMarkdownField. The ActiveRecord::AttributeSet
we build from the cached value does know about these columns so we need manually set them. This fixes the 500 errors from #59208 (closed) without users needing to clear the cache.
What are the relevant issue numbers?
Closes #59208 (closed)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer
/cc @ashmckenzie @jarv
Edited by Douglas Barbosa Alexandre