Revision log message field missing from layout overrides entity form

Created on 16 February 2019, over 5 years ago
Updated 7 October 2023, 8 months ago

Problem/Motivation

The revision log message form component is missing from the override layout entity form.

This is happening because Drupal\layout_builder\Form\OverridesEntityForm::init() currently uses Drupal\Core\Entity\Entity\EntityFormDisplay::collectRenderDisplay() with the $default_fallback parameter set to FALSE to load the entity $form_display. This removes the original components of the entity display form which includes the revision_log component.

Proposed resolution

  • Update Drupal\layout_builder\Form\OverridesEntityForm::init() to add the revision_log_message_form_item component to the entity $form_display if ContentEntityForm::showRevisionUi() is TRUE.
  • Add test(s).

Remaining tasks

Answer #36.2

User interface changes

Revision log message form is displayed on layout override form for entity types that support revisioning.

API changes

None.

Data model changes

None.

Release notes snippet

Update Layout Builder entity overrides form to display revision log message form when appropriate.

Original report by johnwebdev

With #3004536: Move the Layout Builder UI into an entity form for better integration with other content authoring modules and core features β†’ now being committed we have the Revision UI in the Layout Builder UI and when you save an override layout a new revision is created.

However, if you untick the "Create new revision" checkbox, a new revision is created anyway.

Secondly, you're not able to write a revision message.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Layout builderΒ  β†’

Last updated about 21 hours ago

Created by

πŸ‡ΈπŸ‡ͺSweden johnwebdev

Live updates comments and jobs are added and updated live.
  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    Moving to NW for an answer for 36.2

  • πŸ‡©πŸ‡ͺGermany uniquename

    The patch from #48 seems to create a corrupted revision, when saving the layout form without any changes.

    Steps to reproduce:

    1. Get a fresh installed d10.1.5 with layout builder enabled and the patch applied.
    2. Have a content type that has the full view enabled for layout builder.
    3. Create a node of that content type.
    4. This will create the first revision on /node/1/revisions.
    5. Goto /node/1/layout and press save layout without changing anything.
    6. No new revision will show up on /node/1/revisions.
    7. Goto /node/1/layout, move a block an press save layout.
    8. A new revision will show up on /node/1/revisions, but hast the vid 3.

    I've also found that in the DB in node_field_revision are three entries, so 5. created data, but this row has the revision_translation_affected field emtpy. That's why it's not showing up on /node/1/revisions.

Production build 0.69.0 2024