Open
Description
Bug
The following condition is obviously invalid:
Explanation
The resulting query is:
SELECT
`main*table\`.`entity*id`,
`main*table\`.`parent*id`,
`main_table\`.`level`,
IF(c.value*id > 0, c.value, c.value) AS `is*active`,
`main_table\`.`path`
FROM
`catalog*category_entity\` AS `main*table`
LEFT JOIN `catalog*category_entity_int\` AS `d` ON d.attribute_id = 46 AND d.store_id = 0 AND d.entity_id = main_table.entity*id
LEFT JOIN `catalog*category_entity_int\` AS `c` ON c.attribute_id = 46 AND c.store_id = 3 AND c.entity_id = main_table.entity*id
WHERE (main*table.entity*id IN(...))
Attribute is_active\
is joined twice on both the store (c\
) and default scope (d\
). If there is no value available on the store scope (c.value\
) the default scope (d.value
) should be used instead.
Solution
The condition from line 415:
$isActiveExpr = $connection->getCheckSql('c.value_id > 0', 'c.value', 'c.value');
Should be changed to:
$isActiveExpr = $connection->getCheckSql('c.value_id IS NOT NULL', 'c.value', 'd.value');
Note: This bug might not be affecting any Magento code (depends if the is_active
flag is actually being used somewhere).
Metadata
Metadata
Assignees
Labels
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchIssue related to Developer Experience and needs help with Triage to Confirm or Reject it