This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-b1d81b80-c51e-4800-8c20-6281e8d6f796 XWIKI-22336 Open

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

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-17f24911-7201-4e23-82f3-ab5f582ab31d Michael Hamann created this issue on 17/Jul/24 11:40
 
Summary: Updating a page with the REST API makes it non-hidden unless the hidden property is specified
Issue Type: cid:jira-generated-image-avatar-b1d81b80-c51e-4800-8c20-6281e8d6f796 Bug
Affects Versions: 7.3
Assignee: Unassigned
Attachments: image-2024-07-17-11-38-54-977.png
Components: REST
Created: 17/Jul/24 11:40
Priority: cid:jira-generated-image-static-major-90d2fe4d-a2ec-42a8-aa1e-cf30ac81b82d Major
Reporter: Michael Hamann
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":

42686_image-2024-07-17-11-38-54-977.png

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