[TYPO3-core] RFC #12326: EXT:setup CSH mode setting gets lost

Steffen Gebert steffen at steffen-gebert.de
Fri Oct 23 22:26:32 CEST 2009


Hi,

This is an SVN patch request.

Type: Bugfix

Bugtracker references:
http://bugs.typo3.org/view.php?id=12326

Branches: trunk

Problem:
After the EXT:setup rewrite, saved values for select fields aren't  
outputted correctly (the <option/> has no selected="selected, although it  
is the currently saved value for this setting).
So after saving the form, the once changed value for select fields is lost  
and set to the value of the first <option>.

This is caused by variable naming clash:

foreach ($config['items'] as $key => $value) {
   $html .= '<option value="' . $key . '"' .
     ($value == $key ? ' selected="selected"' : '') .
     '>' . $this->getLabel($value,'',false) . '</option>' . chr(10);
}

Solution:
Rename $value $to label, as $value already holds the saved value, we have  
to compare with $key.

Note:
This occurs only on the help mode select box, as all other select boxes  
have a itemsProcFunc, which renders the field.

How to reproduce:
Go to "user settings" and set "Context Sensitive Help mode" to "Display  
help icon only". Save the configuration.
After that, CSH icons are shown, but the value for CSH mode is again  
"Display no help information". As soon as you safe the form, the  
information of the changed setting is lost.
It always falls back to "no help information".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 12326.diff
Type: text/x-diff
Size: 860 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20091023/5ea9657c/attachment.diff>


More information about the TYPO3-team-core mailing list