Skip to content

Commit b368f6a

Browse files
author
Tobias Zander
committed
Prevent a warning in activated developer mode when 'plugins' is no array
1 parent 0efd237 commit b368f6a

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
@@ -254,17 +254,19 @@ protected function _getPluginButtonsHtml($visible = true)
254254
);
255255
}
256256

257-
foreach ($this->getConfig('plugins') as $plugin) {
258-
if (isset($plugin['options']) && $this->_checkPluginButtonOptions($plugin['options'])) {
259-
$buttonOptions = $this->_prepareButtonOptions($plugin['options']);
260-
if (!$visible) {
261-
$configStyle = '';
262-
if (isset($buttonOptions['style'])) {
263-
$configStyle = $buttonOptions['style'];
257+
if (is_array($this->getConfig('plugins'))) {
258+
foreach ($this->getConfig('plugins') as $plugin) {
259+
if (isset($plugin['options']) && $this->_checkPluginButtonOptions($plugin['options'])) {
260+
$buttonOptions = $this->_prepareButtonOptions($plugin['options']);
261+
if (!$visible) {
262+
$configStyle = '';
263+
if (isset($buttonOptions['style'])) {
264+
$configStyle = $buttonOptions['style'];
265+
}
266+
$buttonOptions = array_merge($buttonOptions, ['style' => 'display:none;' . $configStyle]);
264267
}
265-
$buttonOptions = array_merge($buttonOptions, ['style' => 'display:none;' . $configStyle]);
268+
$buttonsHtml .= $this->_getButtonHtml($buttonOptions);
266269
}
267-
$buttonsHtml .= $this->_getButtonHtml($buttonOptions);
268270
}
269271
}
270272

0 commit comments

Comments
 (0)