Skip to content

Commit

Permalink
Issue #2666914 by slashrsm, marcingy: Notice: Undefined index: shakes…
Browse files Browse the repository at this point in the history
…peare_messages in entity_browser_preprocess_page__entity_browser__iframe() - line 70
  • Loading branch information
slashrsm committed Feb 11, 2016
1 parent d0852f6 commit 55caf83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion entity_browser.module
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ function entity_browser_form_alter(&$form, FormStateInterface &$form_state) {
* Tries to figure out where messages block lives and display it separately.
*/
function entity_browser_preprocess_page__entity_browser__iframe(&$variables) {
$variables['messages'] = '';
$blocks = \Drupal::entityTypeManager()->getStorage('block')->loadByProperties([
'theme' => \Drupal::theme()->getActiveTheme()->getName(),
'plugin' => 'system_messages_block',
]);
if ($messages = current($blocks)) {

if (($messages = current($blocks)) && !empty($variables['page'][$messages->getRegion()][$messages->id()])) {
$variables['messages'] = $variables['page'][$messages->getRegion()][$messages->id()];
}
}
Expand Down

0 comments on commit 55caf83

Please sign in to comment.