Skip to content

Commit

Permalink
Merge pull request #70 from magento-ogre/MAGETWO-33227
Browse files Browse the repository at this point in the history
[GITHUB] Prevent a warning in activated developer mode when 'plugins' is no array #995
  • Loading branch information
vpelipenko committed Jan 29, 2015
2 parents 7541ee0 + ab6d04c commit f94717b
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 f94717b

Please sign in to comment.