Skip to content

Commit

Permalink
Issue #2652658 by slashrsm, snehi, esolitos: Broken field administrat…
Browse files Browse the repository at this point in the history
…ion page if used Entity Browser is missing
  • Loading branch information
slashrsm committed Jan 27, 2016
1 parent a0d3351 commit 75249ff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Plugin/Field/FieldWidget/EntityReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,12 @@ public function settingsSummary() {
return [t('No entity browser selected.')];
}
else {
$browser = $this->entityManager->getStorage('entity_browser')
->load($entity_browser_id);
$summary[] = t('Entity browser: @browser', ['@browser' => $browser->label()]);
if ($browser = $this->entityManager->getStorage('entity_browser')->load($entity_browser_id)) {
$summary[] = t('Entity browser: @browser', ['@browser' => $browser->label()]);
} else {
drupal_set_message(t('Missing entity browser!'), 'error');
return [t('Missing entity browser!')];
}
}

if (!empty($field_widget_display)) {
Expand Down

0 comments on commit 75249ff

Please sign in to comment.