190: Render the gallery modal from the paragraph entity instead of by ID - Alternative - #496
Open
dblanken-yale wants to merge 2 commits into
Open
190: Render the gallery modal from the paragraph entity instead of by ID - Alternative#496dblanken-yale wants to merge 2 commits into
dblanken-yale wants to merge 2 commits into
Conversation
The modal rendered via drupal_entity('paragraph', id, ...), which needs a
saved paragraph ID. A newly added gallery item, or one belonging to a block
just cloned in Layout Builder, has no ID yet, so the lightbox came out empty
in the Layout Builder preview even though the media reference was present.
Render from the entity object with twig_tweak's `view` filter instead, which
takes an EntityInterface and keeps the same check_access default.
Refs yalesites-org/YaleSites-Internal#190
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
9 tasks
# Conflicts: # templates/paragraphs/_gallery-item.twig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
190: Add Block Cloning Functionality
Description of work
templates/paragraphs/_gallery-item.twigrendered the lightbox contents withdrupal_entity('paragraph', item.entity.id.0.value, ...), which needs a savedparagraph ID. An unsaved paragraph has none, so the modal came out empty in the Layout
Builder preview even though the media reference was present and the canonical node route
was fine.
viewfilter, which takes anEntityInterfaceand keeps the samecheck_accessdefault — no access change.previewing before save hit the same empty modal. The old
is not iterableguard wassuppressing the error rather than fixing the cause.
option that makes this reachable, and it carries the matching branch name that
build_frontendneeds to swap this branch into the multidev.Functional testing steps:
References yalesites-org/YaleSites-Internal#190
Created with AI