From b368f6a45880dd2f0a7019203f6d7d000e44232d Mon Sep 17 00:00:00 2001 From: Tobias Zander Date: Thu, 22 Jan 2015 18:44:31 +0100 Subject: [PATCH] Prevent a warning in activated developer mode when 'plugins' is no array --- .../Framework/Data/Form/Element/Editor.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php index 6c14e5e5a2b31..36b913059737a 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php @@ -254,17 +254,19 @@ protected function _getPluginButtonsHtml($visible = true) ); } - foreach ($this->getConfig('plugins') as $plugin) { - if (isset($plugin['options']) && $this->_checkPluginButtonOptions($plugin['options'])) { - $buttonOptions = $this->_prepareButtonOptions($plugin['options']); - if (!$visible) { - $configStyle = ''; - if (isset($buttonOptions['style'])) { - $configStyle = $buttonOptions['style']; + if (is_array($this->getConfig('plugins'))) { + foreach ($this->getConfig('plugins') as $plugin) { + if (isset($plugin['options']) && $this->_checkPluginButtonOptions($plugin['options'])) { + $buttonOptions = $this->_prepareButtonOptions($plugin['options']); + if (!$visible) { + $configStyle = ''; + if (isset($buttonOptions['style'])) { + $configStyle = $buttonOptions['style']; + } + $buttonOptions = array_merge($buttonOptions, ['style' => 'display:none;' . $configStyle]); } - $buttonOptions = array_merge($buttonOptions, ['style' => 'display:none;' . $configStyle]); + $buttonsHtml .= $this->_getButtonHtml($buttonOptions); } - $buttonsHtml .= $this->_getButtonHtml($buttonOptions); } }