MDVA-39181: Related product rules show products from categories not defined in the rule
Related product rules show products from categories not defined in the rule. Quality patch MDVA-39181 for magento/module-target-rule applies to Magento Open Source and Adobe Commerce 2.4.1 to 2.4.3-p3.
- Categories
- Catalog/Product
- Components
- magento/module-target-rule
- Origin
- adobe-commerce-support
- Since QPT
- 1.1.10
Issue
Related product rules show products from categories not defined in the rule.
Steps to reproduce
1. Create an attribute brand and add it to the Tops Attribute Set. 1. Choose Josie, Augusta, and Ingrid jackets to add to the Brand Kitty from Women > Tops > Jackets category. 1. Choose Beaumont, Hyperion, and Kenobi jackets to add to the Brand Kitty from Men > Tops > Jacket category. 1. Create a related product with: Apply To: Related Products Customer Segments: All * Products to Match: If ALL of these conditions are TRUE Category is {} Brand is {} * Products to Display: If ALL of these conditions are TRUE Product Category is the same as Matched Product Category Product brand is Matched Product Brand 1. Open SKU WJ04 from the front end and check related products. 1. Update the category ID from Women > Tops > Jackets in case it is different from this.
Adobe's page lists 2.4.1 - 2.4.3-p1 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.
Adobe scheduled the permanent fix for 2.4.5.
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-39181. On Cloud, add MDVA-39181 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-39181/ 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
magento/magento2-ee-base >=2.4.1 <2.4.4
- Magento Open Source
- —
- Patch file
- patches/commerce/MDVA-39181_2.4.2.patch
- vendor/magento/module-target-rule/Model/ResourceModel/Index.php
