Magento hierarchy url does not update when identifier of CMS page changes #39482
Labels
Issue: ready for confirmation
Reported on 2.4.7-p3
Indicates original Magento version for the Issue report.
Preconditions and environment
Steps to reproduce
magento_versionscms_hierarchy_node
to see if therequest_url
of your CMS page has been updatedExpected result
The magento_versionscms_hierarchy_node row has been updated with the correct request_url
Actual result
The update does not happen.
Additional information
Issue Summary:
In the
cms_page_save_after
observer, the VersionsCms module checks whether the page identifier has been changed. If it has, the module attempts to find and update corresponding entries in themagento_versionscms_hierarchy_node
table. This update logic is handled in the methodMagento\VersionsCms\Model\ResourceModel\Hierarchy\Node::updateRequestUrlsForTreeByXpath
.Problem Details:
The issue lies in the following query within the method:
Here, Magento is looking for
xpath
values that either end with a slash or match the exact value appended with a slash. However, thexpath
column in themagento_versionscms_hierarchy_node
table does not store values that end with a slash. As a result, this query always returns zero results, and the expected row update never occurs. Removing the slash in the query above results in Magento correctly updating the rows.Links
This problem has already been discussed in this issue, however no solution was provided in that ticket.
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: