From ef7215735aa84fa3f0768e9a6e8aca20deaeac8d Mon Sep 17 00:00:00 2001
From: SpadXIII <SpadXIII@1826778.no-reply.drupal.org>
Date: Mon, 23 Apr 2018 11:33:06 +0200
Subject: [PATCH] Issue #2940301 by SpadXIII, timplunkett: Warning: Illegal
 offset type in isset or empty

---
 src/Plugin/Block/FieldBlock.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Plugin/Block/FieldBlock.php b/src/Plugin/Block/FieldBlock.php
index e0d7e93..54cc25f 100644
--- a/src/Plugin/Block/FieldBlock.php
+++ b/src/Plugin/Block/FieldBlock.php
@@ -201,7 +201,7 @@ class FieldBlock extends BlockBase implements ContainerFactoryPluginInterface {
       }
       else {
         if (empty($formatter_id)) {
-          $formatter_id = reset($formatter_options);
+          $formatter_id = key($formatter_options);
         }
         $form['formatter']['id'] = [
           '#title' => $this->t('Formatter'),
-- 
GitLab