Problem/Motivation
With live preview, we can add blocks to the layout builder, make updates, and see content changes in real-time. This is great.
We have discovered that this does not play nice with Field Blocks. When these blocks are added, such as the body field, it throws an Ajax error due to missing context on the entity.
Drupal\Component\Plugin\Exception\MissingValueContextException: Required contexts without a value: entity in Drupal\Core\Plugin\Context\ContextHandler->applyContextMapping() (line 155 of core/lib/Drupal/Core/Plugin/Context/ContextHandler.php).
Steps to reproduce
With Live Preview, add a field block via Layout Builder. I.e. a body field. Produces Ajax error.
Proposed resolution
Review and adjust for the missing context.
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
thestevelavigne commentedComment #3
dsnopekHere's a patch that fixes this issue in my limited testing.
@Nugg Can you give it a try?
Comment #5
dsnopekOn Slack, @Nugg let me know that the patch is for working for him! So, committed :-)