From 7d584acbd86a034402047431479aee22759def88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bart=C5=82omiej=20Szubert?= <bartlomiejszubert@gmail.com>
Date: Tue, 23 Apr 2019 23:19:19 +0200
Subject: [PATCH] Fix #20111 - display variables in popup while editing
 existing email template

---
 app/code/Magento/Email/Model/Template.php     |  2 +-
 .../Email/Test/Unit/Model/TemplateTest.php    | 22 ++++++++++---------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/app/code/Magento/Email/Model/Template.php b/app/code/Magento/Email/Model/Template.php
index 8724b725ae489..3ee87cb81dfc4 100644
--- a/app/code/Magento/Email/Model/Template.php
+++ b/app/code/Magento/Email/Model/Template.php
@@ -326,7 +326,7 @@ public function getVariablesOptionArray($withGroup = false)
                 $optionArray[] = ['value' => '{{' . $value . '}}', 'label' => __('%1', $label)];
             }
             if ($withGroup) {
-                $optionArray = ['label' => __('Template Variables'), 'value' => $optionArray];
+                $optionArray = [['label' => __('Template Variables'), 'value' => $optionArray]];
             }
         }
         return $optionArray;
diff --git a/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php b/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php
index 5464ca51cbe35..72aa3078d9067 100644
--- a/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php
+++ b/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php
@@ -598,16 +598,18 @@ public function getVariablesOptionArrayDataProvider()
                     'label' => __('Template Variables'),
                     'value' => [
                         [
-                            'value' => '{{store url=""}}',
-                            'label' => __('%1', 'Store Url'),
-                        ],
-                        [
-                            'value' => '{{var logo_url}}',
-                            'label' => __('%1', 'Email Logo Image Url'),
-                        ],
-                        [
-                            'value' => '{{var customer.name}}',
-                            'label' => __('%1', 'Customer Name'),
+                            [
+                                'value' => '{{store url=""}}',
+                                'label' => __('%1', 'Store Url'),
+                            ],
+                            [
+                                'value' => '{{var logo_url}}',
+                                'label' => __('%1', 'Email Logo Image Url'),
+                            ],
+                            [
+                                'value' => '{{var customer.name}}',
+                                'label' => __('%1', 'Customer Name'),
+                            ],
                         ],
                     ],
                 ],