Bug: Some input buttons use the value-argument as action identifier
Moved this text from the
KnownIssuesOfTWiki01Sep2004 topic.
Whilst "germanizing" pattern skin I noticed that it uses buttons for the actions in the edit window (preview, checkpoint, save, quietsave). If you change the label (i.e. the value) on these buttons, you also have to change the corresponding if-statements in lib/TWiki/UI/Save.pm - otherwise the action defaults to "save". I haven't checked whether other buttons in different templates show the same behaviour. This needs to be fixed because otherwise a translation of the skin becomes very difficult. --
ChristianKohl - 31.08.2004
- This qualifies as a bug, a button label should not be used as an action identifier. -- PTh
Test case
In edit.pattern.tmpl:
<tr class="twikiTopicAction">
<td class="twikiCancelCol"><a id="cancel" href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?unlock=on" accesskey="a">Abbrechen</a></td>
<td class="twikiSubmitCol"><input type="submit" class="twikiSubmit twikiSecondary" name="action" id="checkpoint" value="Zwischenspeichern" /><label access$
<td class="twikiAddCol"><input type="submit" class="twikiSubmit twikiTertiary" name="action" id="preview" value="Vorschau" /><label accesskey="v" for="pre$
</tr>
In order to translate the action buttons into German I had to change the value="..."-value, e.g. from value="Checkpoint" to value="Zwischenspeichern". Unfortunately, these values are passed as arguments to the edit function. So you have to make changes to lib/TWiki/UI/Save.pm as well and modify the corresponding if-statements there. Otherwise, "save" is always performed, regardless of which button you clicked on.
Environment
--
ChristianKohl - 02 Sep 2004
Follow up
This is also in the classic skin.
--
ArthurClemens - 05 Sep 2004
Renamed topic from PatternSkinActionIdentifier.
--
PeterThoeny - 05 Sep 2004
Fix record
I believe this was fixed in svn, revision
6368.
--
AntonioTerceiro - 15 Sep 2005