Restore entity revisions support in FieldBlock

Created on 14 August 2023, 11 months ago
Updated 18 December 2023, 6 months ago

Problem/Motivation

Entity revisions support no longer exists in version 8.x-2.x of the fieldblock module.

It appears that the code added in #2605874: Display fieldblocks on entity revision/preview routes. β†’ was removed at some point in the 8.x-2.x branch.

Steps to reproduce

  1. Add content type with fields (entity reference fields too)
  2. Add a Field Block in Block Layout using fields or paragraphs from your content type
  3. add new content using the content type
  4. edit the content and create new revisions, 2 or 3 revisions to compare
  5. Edit the content and view a revision, you will see revisions for your Field Block is always showing the latest revision

Proposed resolution

Re-add the patch from issue #2605874: Display fieldblocks on entity revision/preview routes. β†’ .

Said patch has been re-uploaded here and included below.

Remaining tasks


User interface changes

Proper support for field and entity revision will be restored as suggested by @casey

API changes

None

Data model changes

None

πŸ› Bug report
Status

RTBC

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States studgate

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

Comments & Activities

  • Issue created by @studgate
  • Status changed to RTBC 6 months ago
  • πŸ‡ͺπŸ‡¨Ecuador jwilson3

    This is RTBC.

    • I've reclassified this as a feature request, since it seems to be a regression.
    • I also cleaned up the issue summary a little bit.
    • I've done a visual code review. I don't see any issues with the code in the patch.
    • I've tested manually (details below).

    Project setup:

    1. Drupal 10 + Paragraphs + FieldBlock;
    2. a paragraphs field on a node type with revisions enabled and
    3. a fieldblock for the paragraphs field enabled into a theme region.

    Manual testing steps:

    1. Create a node with a simple paragraph with some text.
    2. Edit the node a second time, modifying some of the text in the paragraph type.
    3. Edit the node a third time, modyfying even more text.
    4. Go to the node's Revisions tab /node/{nid}/revisions and open all three revisions in new browser tabs.

    Before patch:
    The fieldblock shows the latest revision of the paragraph on all revisions of the node.

    After patch:
    The fieldblock shows the paragraph with the correct text modifications for each revision.

Production build 0.69.0 2024