|
| Description: |
h2. Problem
{{ReleaseNotes.Code.ReleaseNoteTemplate}} carries a dynamic title, {{Release Notes for $doc.getValue('product') $doc.getValue('version')}}, which is handed {{HomeReleaseNotes}} copies to every release note created from the application home page. On a created release note that title resolves, because the page holds a {{ReleaseNoteClass}} xobject with a {{product}} and a {{version}}. That design is sound and is kept.
The template page itself holds no such xobject, so on that page neither reference resolves and Velocity leaves them as literal text. Wherever 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. Why the obvious fix does not work Proposal
Adding a fallback to Give the title ( a fallback for instance the case where the page has no release note xobject, the same idiom {{ 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 }
The template page then reads "Release Note Template", while release notes created from it keep their dynamic title unchanged.
h2. Note for whoever tests this
{{ReleaseNotesIT#createReleaseNoteFromTemplate } ) fixes } used to flatten the display but breaks template title before creating the created release notes note , which then all come makes the fix above look broken (every created release note comes out titled "Release Note Template" ) .
The reason cause is that in the test helper, not in the application: the REST API fills {{ HomeReleaseNotes Page#title }} copies with the *rendered* title with ( {{ $rnDoc ModelFactory}} does {{pageSummary .setTitle( $templateDoc doc . title getDisplayTitle( ) ) }} , ) and a document title is evaluated against the page holding , on save, stores whatever it : what the template hands over is therefore *already rendered* against the template page, which has no release note xobject. The dynamic title only ever survived that copy because an unresolved Velocity reference renders given 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 's raw title ( {{ $templateDoc doc . setTitle(restPage. getTitle() ) }} instead of {{$templateDoc ) . So a plain REST get/save round-trip on a page whose title }} makes no difference holds Velocity silently replaces that title with its rendered form .
h2. Proposal
Stop routing The helper that turns required rights on for 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 did exactly what that. It now clears the dynamic title resolved to anyway before saving , and put so that string in the {{ReleaseNotes stored one is left alone . 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, and a customised template title This is no longer used worth keeping in mind for the created release notes any other code doing a REST round-trip on a page with a scripted title . |
| Attachment: |
release-notes-template-picker.png |
| Attachment: |
release-notes-template-picker.png |
|