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,
      ];
    }

CommentFileSizeAuthor
Screenshot 2023-11-01 at 11.25.20.png75.42 KBlexsoft

Issue fork storage-3398304

Command icon 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

lexsoft created an issue. See original summary.

Shreya_th made their first commit to this issue’s fork.

shreya_th’s picture

Status: Active » Needs review
lexsoft’s picture

You've stolen my thunder and that's not the complete solution :(

mortona2k’s picture

This worked for me. Anything else needed?

mandclu’s picture

Status: Needs review » Reviewed & tested by the community

I 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?

mandclu’s picture

Version: 1.3.1 » 1.4.x-dev

  • mandclu committed b67bf62e on 1.4.x authored by shreya_th
    [#3398304] fix: Create new revision checkbox showing 2 times
    
    By:...
mandclu’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone. Merged this in, and will try to roll a new release shortly.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.