QUALITY PATCH

MDVA-33606: When trying to save a CMS page assigned to hierarchy tree…

When trying to save a CMS page assigned to hierarchy tree, users get the following error message: Unique constraint violation found. Quality patch MDVA-33606 for magento/module-versions-cms applies to Magento Open Source and Adobe Commerce 2.4.1 to 2.4.2-p2.

Categories
Content
Components
magento/module-versions-cms
Origin
adobe-commerce-support
Since QPT
1.1.3

Issue

When trying to save a CMS page assigned to hierarchy tree, users get the following error message: Unique constraint violation found.

Steps to reproduce

1. Create a new CMS page. Set the scope to All Store Views. This is your CMS Page 1. 1. Create a new store view. This is your Store View 2. 1. Go to Content > Hierarchy > Add the CMS Page 1 to hierarchy tree. 1. Change the scope to Store View 2. * Uncheck "Use the parent node hierarchy". * Add CMS Page 1 to this scope and save it. 1. Now change the scope to Default Store View. * Uncheck "Use the parent node hierarchy". * Add CMS Page 1 to this scope and save it. 1. Go to Content > Pages > Add New Page. * Title the page as Page 2. * In the Page in Websites section, assign to All Store Views and both store views (Default Store View and Store View 2) and click Save Page. 1. In the CMS edit page, open the Hierarchy tab. * Assign Page 2 to Store View 2 node, Default node, and All Websites node.

Adobe's page lists 2.4.1-2.4.2-p2 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply MDVA-33606. On Cloud, add MDVA-33606 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its MDVA-33606/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (1): magento/module-versions-cms

magento/magento2-ee-base >=2.4.1 <=2.4.2-p2

Magento Open Source
—
Adobe Commerce
2.4.2-p2, 2.4.2-p1, 2.4.2, 2.4.1-p1, 2.4.1
Patch file
patches/commerce/MDVA-33606_2.4.1.patch
  • vendor/magento/module-versions-cms/Block/Adminhtml/Cms/Page/Edit/Tab/Hierarchy.php
  • vendor/magento/module-versions-cms/Observer/Backend/CmsPageSaveAfterObserver.php

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.