Problem/Motivation
When selecting to show the revision checkbox you will both the entity default revision checkbox and the one provided by storage module.
Steps to reproduce
Drupal Version
10.1.5
Web Server
nginx/1.24.0
PHP
Version
8.1.22 (more information)
Enable Expose revision checkbox and Expose revision log

Proposed resolution
Merge the available revision checkbox with functionality provided by storage.
// Only expose the log field if so configured.
if (!$bundle->shouldShowRevisionLog()) {
$form['revision_log']['#access'] = FALSE;
}
if ($bundle->shouldShowRevisionToggle()) {
if (!$this->entity->isNew()) {
$form['revision']['#default_value'] = $revision_default;
}
}
else {
$form['revision_information']['#access'] = FALSE;
$form['revision']['#access'] = FALSE;
$form['new_revision'] = [
'#type' => 'value',
'#value' => $revision_default,
];
}
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2023-11-01 at 11.25.20.png | 75.42 KB | lexsoft |
Issue fork storage-3398304
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
shreya_th commentedComment #5
lexsoft commentedYou've stolen my thunder and that's not the complete solution :(
Comment #6
mortona2k commentedThis worked for me. Anything else needed?
Comment #7
mandclu commentedI was able to reproduce the cited issue and verify that with the patch applied, the additional checkbox is not seen. The only potential issue I see is that with an existing storage bundle, if you click to enable the revision checkbox in the bundle configuration, you will not immediately see the revision option in the form. You need to also enable the field in the form display. Would we say that's expected behaviour?
Comment #8
mandclu commentedComment #10
mandclu commentedThanks everyone. Merged this in, and will try to roll a new release shortly.