-
Notifications
You must be signed in to change notification settings - Fork 150
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(editor-interface): control changes of newly created fields should not trigger errors for editor interfaces with editorLayout property #1142
Merged
damienxy
merged 4 commits into
master
from
fix/zend-2771-add-new-field-to-controls-with-editor-interface-that-uses-editor-layout
Nov 14, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruderngespra
force-pushed
the
fix/zend-2771-add-new-field-to-controls-with-editor-interface-that-uses-editor-layout
branch
from
November 10, 2022 11:54
098ba6d
to
ade4f7c
Compare
…rLayout present fix(editor-interface): add more unit tests for field control updates
…ontrol updates fix(editor-interface): use available util functions for id check
ruderngespra
force-pushed
the
fix/zend-2771-add-new-field-to-controls-with-editor-interface-that-uses-editor-layout
branch
from
November 10, 2022 14:28
5970bbb
to
779784b
Compare
andreascful
approved these changes
Nov 11, 2022
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.
Very good concise change. Great that you figured out this hard issue!
ruderngespra
changed the title
fix(editor-interface-controls): control changes of newly created fields should not trigger errors for editor interfaces with editorLayout property
fix(editor-interface): control changes of newly created fields should not trigger errors for editor interfaces with editorLayout property
Nov 11, 2022
mayakarabula
approved these changes
Nov 11, 2022
veu
approved these changes
Nov 11, 2022
Silhoue
reviewed
Nov 11, 2022
Co-authored-by: Joanna Zakrzewska <[email protected]>
damienxy
deleted the
fix/zend-2771-add-new-field-to-controls-with-editor-interface-that-uses-editor-layout
branch
November 14, 2022 14:32
🎉 This PR is included in version 4.12.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are seeing a few customer complaints for migration scripts which create new fields on a content type and then immediately change field controls for the newly created field in the same migration script. Customers run into a validation error and then are unable to do the field control changes. The reason for this is whenever field updates happen on content types which have corresponding
editorInterfaces
witheditorLayout
properties, thoseeditorInterfaces
are silently updated as well by our API. Contentful-migration however does not know about this and therefore sends an outdated payload to theeditor_interface
endpoint.This PR aims to hotfix the issue for creating fields by adding a custom check during
editorInterface
updates that detects whether for a giveneditorInterface
there is afieldId
missing ineditorLayout
and if so silently adds the id to the first group. This way, it mimics the implicit update to theeditorInterface
which silently happened in the backend and thereby avoids validation errors on the update.what this is not yet solving
On the long run, we should make sure that the migration tool always has access to the updated
editorInterfaces
it applies migrations to, so we might think about re-fetchingeditorInterfaces
after content type updates which involve field updates.todos
editorLayout
if two layers of nesting is enough ✅