From 358bf839334bb03c299223bd6806f8ef01fcf3f8 Mon Sep 17 00:00:00 2001 From: adragus-inviqa Date: Thu, 13 Oct 2016 11:33:52 +0100 Subject: [PATCH 1/2] Allow extending config variables Currently, you can't elegantly extend the config variables via plugins. A plugin would have to take care of both `toOptionArray()` _and_ `getData()`. By using a method call, now plugins can inject themselves in two places in one go. --- app/code/Magento/Email/Model/Source/Variables.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Email/Model/Source/Variables.php b/app/code/Magento/Email/Model/Source/Variables.php index 87f07db028157..8bf42ace340c7 100644 --- a/app/code/Magento/Email/Model/Source/Variables.php +++ b/app/code/Magento/Email/Model/Source/Variables.php @@ -61,7 +61,7 @@ public function __construct() public function toOptionArray($withGroup = false) { $optionArray = []; - foreach ($this->_configVariables as $variable) { + foreach ($this->getData() as $variable) { $optionArray[] = [ 'value' => '{{config path="' . $variable['value'] . '"}}', 'label' => $variable['label'], From 90b080746a31f139f041bc0456c85b52327798c2 Mon Sep 17 00:00:00 2001 From: adragus-inviqa Date: Thu, 13 Oct 2016 11:38:40 +0100 Subject: [PATCH 2/2] Remove redundant space --- app/code/Magento/Email/Model/Source/Variables.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Email/Model/Source/Variables.php b/app/code/Magento/Email/Model/Source/Variables.php index 8bf42ace340c7..3176ec07d6e53 100644 --- a/app/code/Magento/Email/Model/Source/Variables.php +++ b/app/code/Magento/Email/Model/Source/Variables.php @@ -81,6 +81,6 @@ public function toOptionArray($withGroup = false) */ public function getData() { - return $this->_configVariables; + return $this->_configVariables; } }