In a
TWikiForm each field can have a name and a title. The name is used as a key to refer to the associated
value in the form; the title is used to display the formfield in the form...
For example let's have a ProjectForm definition with a row like this
| [[ProjectStatusList][ProjectStatus]] | select | 1 | | The status of the project |
This has the effect that in edit mode the "ProjectStatus" label will be rendered as a link to
ProjectStatusList...but not so when displaying the form in view mode.
So while the label links perfectly in edit mode, it is broken in view mode.
Moreover, the META:FIELD as it has been stored to the topic currently is:
META:FIELD{name="ProjectStatus" attributes="" title="ProjectStatus" value="blabla"}
The title information is not stored to the topic's META:FIELD. It is only available in the form definition.
I would have expected
META:FIELD{name="ProjectStatus" attributes="" title="ProjectStatusList" value="blabla"}
or
META:FIELD{name="ProjectStatus" attributes="" title="[[ProjectStatusList][ProjectStatus]]" value="blabla"}
Looking at the code
TWiki::Form::renderForEdit()
the both parts of the bracket link are treated as
[[title][name]]
But not so in
TWiki::Form::renderForDisplay()
. The
title
is used as a fallback when the
name
is
not defined...a case that barely occurs at all. The
title
&
name
pair of a formfield is used
inconsistent in view and edit mode.
--
TWiki:Main/MichaelDaum
- 09 May 2007
This issue is restricted to fields that use the squab syntax for the link. the problem is that the defining topic is pulled off when the form is parsed, and isn't put back when the meta-data is saved.
CC