Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-22037

AWM Display as hidden field should not be displayed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 16.2.0
    • App Within Minutes
    • 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:

      1. Create a new app with App Within Minutes named 'TestHidden'
      2. Add a field of type 'Content'
      3. Create a new object with the app
      4. Edit the page 'TestHidden/Code/TestHiddenSheet'
      5. Replace this line $doc.display('content1') by $doc.display('content1', 'hidden')
      6. Save the page
      7. View the previously created object
      8. 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}}', '&amp;#123;&amp;#123;/html&amp;#125;&amp;#125;')
        </div>
        {{/html}}
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            josue Josué Tille
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: