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

Sheets that check for the context 'view' action don't work when displaying a revision

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 13.0
    • 8.3
    • Old Core
    • None
    • Unknown

    Description

      Steps to reproduce:

      1. Create document A.Sheet (terminal) with the content:
        {{velocity}}
        Sheet says:
        #if ($xcontext.action == 'view')
          $doc.content
        #end
        {{/velocity}}
        
      2. Create document A.WebHome with the content:
        Hello World!
        
      3. Edit A.WebHome in object mode and add a DocumentSheetBinding to "Sheet"
      4. View the document A.WebHome and observe the sheet displaying the content:
        Sheet says:
        Hello World!
        
      5. View the history of document A.WebHome and click on a revision (e.g. the most recent).
      6. See that the content of the document is not displayed by the sheet:
        Sheet says:
        

      Since many applications end up writing sheets that check for the view action, the impact of this is quite large.

      Cause identified by tmortagne.

      Solutions proposed also by tmortagne:

      1. Deprecate the viewrev action and have the view action handle the rev parameter (and show the latest revision for an empty rev parameter value) instead of redirecting to viewrev like it does now.
        • (recommended)
      2. Make the viewrev action set the context action to view.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              enygma Eduard Moraru
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: