Skip to content

Commit f94717b

Browse files
committed
Merge pull request #70 from magento-ogre/MAGETWO-33227
[GITHUB] Prevent a warning in activated developer mode when 'plugins' is no array #995
2 parents 7541ee0 + ab6d04c commit f94717b

File tree

1 file changed

+11
-9
lines changed
  • lib/internal/Magento/Framework/Data/Form/Element

1 file changed

+11
-9
lines changed

lib/internal/Magento/Framework/Data/Form/Element/Editor.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,17 +261,19 @@ protected function _getPluginButtonsHtml($visible = true)
261261
);
262262
}
263263

264-
foreach ($this->getConfig('plugins') as $plugin) {
265-
if (isset($plugin['options']) && $this->_checkPluginButtonOptions($plugin['options'])) {
266-
$buttonOptions = $this->_prepareButtonOptions($plugin['options']);
267-
if (!$visible) {
268-
$configStyle = '';
269-
if (isset($buttonOptions['style'])) {
270-
$configStyle = $buttonOptions['style'];
264+
if (is_array($this->getConfig('plugins'))) {
265+
foreach ($this->getConfig('plugins') as $plugin) {
266+
if (isset($plugin['options']) && $this->_checkPluginButtonOptions($plugin['options'])) {
267+
$buttonOptions = $this->_prepareButtonOptions($plugin['options']);
268+
if (!$visible) {
269+
$configStyle = '';
270+
if (isset($buttonOptions['style'])) {
271+
$configStyle = $buttonOptions['style'];
272+
}
273+
$buttonOptions = array_merge($buttonOptions, ['style' => 'display:none;' . $configStyle]);
271274
}
272-
$buttonOptions = array_merge($buttonOptions, ['style' => 'display:none;' . $configStyle]);
275+
$buttonsHtml .= $this->_getButtonHtml($buttonOptions);
273276
}
274-
$buttonsHtml .= $this->_getButtonHtml($buttonOptions);
275277
}
276278
}
277279

0 commit comments

Comments
 (0)