1. Enable Content Moderation module.
2. Create a new content type. Accept the defaults. "Create new revision" will be checked and grayed out (it appears the disabling is done by Content Moderation).
3. At this point, the new content type is not yet subject to Content Moderation. Create a node of the content type. Save the node.
4. Edit the node you just saved. The "Create new revision" box will NOT be checked, even though it should be checked (because "Create new revision" is checked on the content type edit page).
When you export the config with "drush cim", the config for the content type has "new_revision: false", but the interface shows it as checked (true).
Comments
Comment #2
timmillwoodThanks for opening the issue!
Looks like instead of altering the form in
\Drupal\content_moderation\Entity\Handler\NodeModerationHandlerwe should alter the actual config (and the form). We should also only do the alters if moderation is enabled.Comment #4
wim leersAFAICT this could lead to unexpected data loss?
Comment #5
Georgii commented@timmillwood
#2
I think that modifying the form may still be needed to cover the case of creating new content types. However this approach require some investigation as well because of the following. It looks like Drupal ignores any field that is
['#disabled']. Therefore the following code will not force a node type to become "new revision by default" even if you create or update that node type.I guess you mean when Moderation is actually enabled for a certain content or block type. Right?
Comment #6
merilainen commentedFYI Workbench moderation has the same issue and I suppose the fix was to change #default_value to #value #2852063: Enforced "Create new revision" isn't saved to the config. I don't use that module so I haven't tried the patch out.
Comment #7
timmillwoodClosing in favour of #2865223: Node type form alter sets new revision to false on subsequent saves