Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
16.2.0
-
None
-
Unknown
-
Description
Hello,
When we create an app with AWM and after edit the Class sheets and replace on one field this part
$doc.display('content1')
by
$doc.display('content1', 'hidden')
we expect to have the edited field hidden. Currently the field still be shown.
It look like that the case is not correctly managed here: https://github.com/xwiki/xwiki-platform/blob/3f7ba76e2dd91a8b71781a474666f451439718ae/xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-ui/src/main/resources/AppWithinMinutes/Content.xml#L79
Step to reproduce:
- Create a new app with App Within Minutes named 'TestHidden'
- Add a field of type 'Content'
- Create a new object with the app
- Edit the page 'TestHidden/Code/TestHiddenSheet'
- Replace this line $doc.display('content1') by $doc.display('content1', 'hidden')
- Save the page
- View the previously created object
- See that the field set as 'hidden' are still shown.
My suggestion to fix it would be to add this following code between theses 2 lines: https://github.com/xwiki/xwiki-platform/blob/3f7ba76e2dd91a8b71781a474666f451439718ae/xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-ui/src/main/resources/AppWithinMinutes/Content.xml#L78-L79
#elseif ($type == 'hidden') {{html clean="false"}} <div class="hidden"> $services.display.content($tdoc, { 'displayerHint': 'default' }).replace('{{/html}}', '&#123;&#123;/html&#125;&#125;') </div> {{/html}}