- last update
over 1 year ago 35 pass, 6 fail - First commit to issue fork.
- πΈπͺSweden twod Sweden
We have some fairly big entities and try to limit the number of revisions created for minor changes like typo fixes. We also have Content Moderation enabled, but override it to re-enable unchecking the "New revision" checkbox.
Our overrides now work well in most cases, except when you have added a paragraph in a Draft (non-default) revision, and try to update it without creating yet another revision. Then we basically run into the scenario from #11 (but instead of reverting to a previous revision we keep modifying the latest non-default one). The main change we've made is overriding
NodeModerationHandler
to not create a new revision, but still toggle published/unpublished - more or less what happens if saving a moderated entity in syncing mode.This means the approach in #20 won't work for us, or anyone else not always using Content Moderation to always handle the default revision state.
It think the approach in #10 was closer to what we need, except it was missing the case when you add a new referenced entity to a draft of the parent, and then change the parent to be the default revision without creating a new revision.
The included tests first check that creating a new non-default revision does not make the referenced entity the default, preserving existing behavior, but it's also adding a new referenced entity which becomes the default revision because it's new.
Then it checks that updating the draft does not modify the default revision state of either referenced entity. This currently fails for the new referenced entity and causes the issue we saw.
The last part of the test "promotes" the existing draft revision to the default revision, and checks that both referenced entities are also promoted to being the default revision - ensured by the new condition added from the #10 patch.
- Merge request !34Only sync default state for new revisions, unless the parent changes to be the default revision. β (Open) created by twod
- last update
about 1 year ago 39 pass - last update
about 1 year ago 39 pass - last update
about 1 year ago 39 pass - πΈπͺSweden twod Sweden
I'm not sure how I got it to fail with a shared table field like name earlier, maybe I had accidentally changed something in core I didn't notice.
The problem does appear there, but is masked by the shared field seemingly always being loaded from the revisions field table if it exists, while dedicated fields are not. - last update
about 1 year ago 28 pass, 1 fail