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

Updating a page with the REST API makes it non-hidden unless the hidden property is specified

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 16.8.0-rc-1
    • 7.3
    • REST
    • None
    • Unknown

    Description

      Steps to reproduce:

      1. Create a hidden page
      2. Execute the following snippet in the browser's console: 
        fetch(require('xwiki-meta').restURL, {
          method: 'PUT',
          headers: {
            'Content-Type': 'application/json',
            'Accept': 'application/json'
          },
          body: JSON.stringify({
            content: 'Updated content'
          })
        })
        .then(response => response.json())
        .then(json => {
          console.log('Response:', json);
        })
        .catch(error => {
          console.error('Error sending PUT request:', error);
        }); 

      Expected result:

      The page is still hidden but its content is now "Updated content".

      Actual result:

      The page is no longer hidden and its content is now "Updated content":

      The code that causes this has been introduced in XWIKI-12783.

      Attachments

        Activity

          People

            MichaelHamann Michael Hamann
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: