Update DXPR Builder to Synchronize Latest Block Revisions in Layout Builder database table

Created on 27 May 2024, 6 months ago

copy of https://github.com/dxpr/dxpr_builder/issues/2682

## Why are we doing this work

To ensure that block revisions made through DXPR Builder to inline blocks* are accurately reflected in the Layout Builder's configurations, maintaining consistency across user sessions and edits.

\* inline blocks are a concept in Drupal core Layout Builder, these blocks are created and edited exclusively in the Layout Builder UI.

## Bug

It's not really a bug because we don't officially support inline blocks created with layout builder, however it is almost working! so we can describe it as a bug.

### Steps to reproduce

video: https://app.screencastify.com/v3/watch/4EwGUGgyaWfcIusRoM1z

1. Save a DXPR Builder drag and drop block that is inside a Layout Builder node (After adding an element)
2. Reload page

### Bug behavior

Page is not showing the element you added, because it is loading an older revision

### Correct behavior

Page should load the latest revision of the block which contains the elements.

## Requirements

* Solution needs to be abstracted enough that it can support Layout Builder anywhere Layout Builder can be used. For example not just on nodes, Layout Builder can also be used on User Profiles or other entity types (blocks, products etc.)
* Solution needs to ensure consistent and reliable active-revision between saves done with both core Layout Builder and DXPR Builder without losing data from either UI.
* If it is not feasible to make this work for any type of host entity, we first create a solution that works just for nodes

## Relevant links

* https://www.drupal.org/project/drupal/issues/3052042 ( Discussion of why this problem exists )
* https://www.drupal.org/project/entity_usage/issues/3060687 ( came across this and I wonder if this code is useful for us in learning information about the host entity (type / ID))

## Non-functional requirements

- [ ] Documentation: Update module documentation to reflect changes in revision handling and HTML markup enhancements.
- [ ] Feature flag: Implement behind a feature flag for phased rollout.
- [ ] Performance: Ensure updates do not significantly impact page load times or server response times.
- [ ] Testing: Comprehensive testing plan to cover new functionality and regression tests.

## Implementation plan

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇳🇱Netherlands jurriaanroelofs

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

Comments & Activities

Production build 0.71.5 2024