Skip to content

Commit

Permalink
Merge pull request #995 from airbone42/prevent-warning
Browse files Browse the repository at this point in the history
Prevent a warning in activated developer mode when 'plugins' is no array
  • Loading branch information
Anton Makarenko committed Jan 26, 2015
2 parents 5e59d46 + b368f6a commit 1803026
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/internal/Magento/Framework/Data/Form/Element/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,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);
}
}

Expand Down

0 comments on commit 1803026

Please sign in to comment.