Create new revision checkbox showing 2 times

Created on 1 November 2023, over 1 year ago

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

๐Ÿ› Bug report
Status

Active

Version

1.3

Component

Code

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom lexsoft London

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @lexsoft
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shreya_98

    Shreya_th โ†’ made their first commit to this issueโ€™s fork.

  • @shreya_th opened merge request.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom lexsoft London

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

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mortona2k Seattle

    This worked for me. Anything else needed?

  • Status changed to RTBC 2 days ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    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?

Production build 0.71.5 2024