Skip to content

Commit

Permalink
[bug-OpenMage#107] getCommentText() for <groups> in system.xml not su…
Browse files Browse the repository at this point in the history
…pported

In system.xml <comment> has a diffent behavior for <fields> and <groups>.
This only works for <fields>:

```
<comment>
    <model>namespace/module<model>
</comment>
```
  • Loading branch information
sreichel authored and edannenberg committed Oct 25, 2019
1 parent 57ce79e commit 80ede57
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/code/core/Mage/Adminhtml/Block/System/Config/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected function _initGroup($form, $group, $section, $parentElement = null)
$helperName = $this->_configFields->getAttributeModule($section, $group);
$fieldsetConfig = array('legend' => Mage::helper($helperName)->__((string)$group->label));
if (!empty($group->comment)) {
$fieldsetConfig['comment'] = Mage::helper($helperName)->__((string)$group->comment);
$fieldsetConfig['comment'] = $this->_prepareGroupComment($group, $helperName);
}
if (!empty($group->expanded)) {
$fieldsetConfig['expanded'] = (bool)$group->expanded;
Expand Down Expand Up @@ -525,6 +525,18 @@ protected function _prepareFieldComment($element, $helper, $currentValue)
return $comment;
}

/**
* Support models "getCommentText" method for group note generation
*
* @param Mage_Core_Model_Config_Element $element
* @param string $helper
* @return string
*/
protected function _prepareGroupComment($element, $helper)
{
return $this->_prepareFieldComment($element, $helper, null);
}

/**
* Prepare additional comment for field like tooltip
*
Expand Down

0 comments on commit 80ede57

Please sign in to comment.