|
| Description: |
h2. Problem
{{ReleaseNotes.Code.ReleaseNoteTemplate}} carries a dynamic title, {{Release Notes for $doc.getValue('product') $doc.getValue('version')}}, which is copied verbatim into handed to every release note created from the application home page. On the a created page release note that title resolves correctly , because the page holds a {{ReleaseNoteClass}} xobject with a {{product}} and a {{version}}.
The template page itself holds no such xobject, so neither reference resolves and Velocity leaves them as literal text. Everywhere the raw script is what the user is shown wherever the template page is displayed by its title , the user is shown the raw script instead of a name :
* in the "Template Reference" page picker of the wiki administration (Administration > Other > Release Notes), which is exactly where an administrator is asked to pick that page * on the template page itself, in its breadcrumb, in search results and in the document index
h2. Proposal Why the obvious fix does not work
Give the title Adding a fallback for to the case where the page has no release note xobject, the same idiom title (for instance {{ ReleaseNotes.Code.Change.ChangeSheet}} already uses:
{code:none} #if ("$!doc.getValue('product')" != '') Release Notes for $doc . getValue('product') $doc . getValue('version') . #{else}Release Note Template#end {code } }) fixes the display but breaks the created release notes, which then all come out titled "Release Note Template".
The reason is that {{HomeReleaseNotes}} copies the title with {{$rnDoc.setTitle($templateDoc.title)}}, and a document title is evaluated against the page holding it: what the template hands over is therefore *already rendered* against the template page then reads , which has no release note xobject. The dynamic title only ever survived that copy because an unresolved Velocity reference renders as its own source text, so the rendered title happened to be identical to the raw one. That accident is the very thing that makes the template page display the script. Using {{$templateDoc.getTitle()}} instead of {{$templateDoc.title}} makes no difference.
h2. Proposal
Stop routing the release note title through the template title:
* title the created release note from the product and the version it is created for, which is exactly what the dynamic title resolved to anyway, and put that string in the {{ReleaseNotes.Code.Translations}} bundle * give the template page the plain title "Release Note Template"
Note that this makes the release note title static: editing the {{product}} or {{version}} xproperty of an existing release note afterwards no longer changes its title , while and a customised template title is no longer used for the created release notes created from it keep their dynamic title unchanged . |
| Attachment: |
release-notes-template-picker.png |
|