Revision log message field missing from layout overrides entity form

Created on 16 February 2019, almost 6 years ago
Updated 17 February 2023, almost 2 years 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

10.1 ✨

Component
Layout builderΒ  β†’

Last updated 2 days 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 Berlin

    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.

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

    Patch #48 resolves the issue for us

Production build 0.71.5 2024