Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Two issues have come up which there seems to be general consensus that SynchronizableInterface
is appropriate for:
- #2803717: Allow 'syncing' content to be updated in content moderation without forcing the creation of a new revision
- #2329253: Allow the ChangedItem to skip updating the entity's "changed" timestamp when synchronizing (f.e. when migrating)
Questions have been raised on the appropriateness of the interface, so there should be some better docs describing what it's for and what users can expect by using it.
Proposed resolution
Add docs to the interface.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#2 | 3057483-2.patch | 1.49 KB | Sam152 |
Comments
Comment #2
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedI think it makes sense to block behind the other two issues, since they are used as examples here.
Comment #3
tstoecklerThanks for opening this, I think this is a great idea.
Some notes:
I think we should add something "... or a POST or PATCH request via JSON API." or something like that otherwise I think people could incorrectly put that example in the "synchronizing example, as well.
I think those should be explained in further details, if we want to have them as examples. At the very least I don't really understand what the use-case or concrete example is there.
Also what about the migration example? I think that actually fits quite well (as you yourself noted in that issue, as well).
Comment #4
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedActually, I think a better real world example might be in core: media updating queued thumbnails: #2987911: Make media compatible with content moderation:
Comment #5
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #13
kristiaanvandeneyndeI am currently facing this issue in the Group module where I feel I have to reject a patch that sets content entities to syncing because the interface specifically points out this is mainly about data imports (config import, migrate, ...): #2872697: Node update hook is triggered upon group content create
They are correctly figuring out that workspaces will not create a new revision on syncing content and therefore set the flag to prevent that from happening. It would be cool if we kept this flag (isSyncing) for the intended purpose as documented on the interface, but also introduce a new flag that can only be checked for updates: isInternalUpdate.
When this flag is set you could also choose not to create a revision, but at least you'd have the choice to differentiate between imported content and content that was (updated with internal data only. Either way, I think it's dangerous to repurpose an existing interface as you cannot know what contrib has already done with it.
So maybe leave SynchronizableInterface as is, but come up with a new interface for internal data changes such as metadata, certain flags, adding something to a group, updating nested set values (left and right), ...