Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #311: Undefined index: #entity_type in ui_patterns_layouts_entity_view_alter(). #319

Open
wants to merge 1 commit into
base: 8.x-1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/ui_patterns_layouts/ui_patterns_layouts.module
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function ui_patterns_layouts_preprocess_ds_entity_view(&$variables) {
function ui_patterns_layouts_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
if ($display instanceof EntityDisplayWithLayoutInterface && isset($build['_field_layout']['#type']) && $build['_field_layout']['#type'] == 'pattern') {
$build['_field_layout']['#context']['type'] = 'layout';
$build['_field_layout']['#context']['entity_type'] = $build['#entity_type'];
$build['_field_layout']['#context']['entity_type'] = $entity->getEntityTypeId();
$build['_field_layout']['#context']['bundle'] = $entity->bundle();
$build['_field_layout']['#context']['view_mode'] = $build['#view_mode'];
$build['_field_layout']['#context']['entity_id'] = $entity->id();
Expand Down