diff --git a/core/includes/entity.inc b/core/includes/entity.inc index 174909d..c2f0217 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -693,6 +693,7 @@ function entity_get_display($entity_type, $bundle, $view_mode) { 'targetEntityType' => $entity_type, 'bundle' => $bundle, 'mode' => $view_mode, + 'status' => TRUE, )); } @@ -731,8 +732,12 @@ function entity_get_render_display(EntityInterface $entity, $view_mode) { // the default and the view mode that is passed in. Depending on the status // of the view mode entity display, we fall back on default. $render_view_mode = 'default'; - $entity_form_displays = entity_load_multiple('entity_display', array('default', $view_mode)); - if (isset($entity_form_displays[$view_mode]) && $entity_form_displays[$view_mode]->status()) { + $load = array( + $entity->entityType() . '.' . $entity->bundle() . '.default', + $entity->entityType() . '.' . $entity->bundle() . '.' . $view_mode, + ); + $entity_displays = entity_load_multiple('entity_display', $load); + if (isset($entity_displays[$entity->entityType() . '.' . $entity->bundle() . '.' . $view_mode]) && $entity_displays[$entity->entityType() . '.' . $entity->bundle() . '.' . $view_mode]->status) { $render_view_mode = $view_mode; } @@ -791,6 +796,7 @@ function entity_get_form_display($entity_type, $bundle, $form_mode) { 'targetEntityType' => $entity_type, 'bundle' => $bundle, 'mode' => $form_mode, + 'status' => TRUE, )); } @@ -825,8 +831,12 @@ function entity_get_render_form_display(EntityInterface $entity, $form_mode) { // the default and the form mode that is passed in. Depending on the status // of the form mode entity display, we fall back on default. $render_form_mode = 'default'; - $entity_form_displays = entity_load_multiple('entity_form_display', array('default', $form_mode)); - if (isset($entity_form_displays[$form_mode]) && $entity_form_displays[$form_mode]->status()) { + $load = array( + $entity->entityType() . '.' . $entity->bundle() . '.default', + $entity->entityType() . '.' . $entity->bundle() . '.' . $form_mode, + ); + $entity_displays = entity_load_multiple('entity_display', $load); + if (isset($entity_displays[$entity->entityType() . '.' . $entity->bundle() . '.' . $form_mode]) && $entity_displays[$entity->entityType() . '.' . $entity->bundle() . '.' . $form_mode]->status) { $render_form_mode = $form_mode; }