Skip to content

Updating CMS page via api should NOT remove related URL rewrites #28370

@SzabKel

Description

@SzabKel

Preconditions (*)

  1. Magento ver. 2.3.3 (I tested this on two different environments, one is our hosted magento solution, other one is a bitnami virtual machine. )
  2. Setup an integration for the rest api, allow CMS actions

Steps to reproduce (*)

  1. Add a new CMS Page, magento will automatically add a rewrite for each language (according to your URL-Key / Identifier field)
    IMG
  2. Manually add a rewrite from any URL pointing to the CMS Page
    IMG
  3. Run a request using the rest api and update the CMS Page's content:
curl --location --request PUT 'http://.../rest/V1/cmsPage/7' \
--header 'Authorization: Bearer ****' \
--header 'Content-Type: application/json' \
--data-raw '{
	"page": {
		"id": 7,
		"title": "test",
		"identifier": "test",
		"content": "content updated"
	}
}'

The title field is required. I also tried to update without the identifier field specified in the request, but I get the same result.

Expected result (*)

The previously added rewrite should be still active. Maybe if the identifier is changed, the rewrites should be updated.

Actual result (*)

The rewrites are deleted and a new rewrite is added for the CMS page. This is easy to see, because every time I do an update, the default rewrite's id is incremented.

Connected

This issue seems related.


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S1 I think? The user's data is deleted and you can't do anything against it, but there is a workaround (posted in a comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions