Open pmzandbergen opened 9 months ago
Hi @pmzandbergen. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hello @sidolov I've checked fixes from this PR and researched history of the fixed logic. This logic is more than 12 years old. It looks like this logic was migrated from Magento1. I am sure this fixes can affect a lot of Magento-projects, 3rd-party extensions, etc, which may be depend on results of it. So, I think we need to discuss it on the guild. Could you please create an internal jira issue to discuss it on the necessary guild.
Thank you in advance.
Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. Hello @pmzandbergen,
Thanks for the report and collaboration!
We have verified the issue by looking into the codebase:
This statement does not make any sense if in any case, we need to use c.value
. Either we need to remove the condition or replace the condition as below:
$isActiveExpr = $connection->getCheckSql('c.value_id > 0', 'c.value', 'd.value');
Hence confirming the issue.
Thanks
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-11011 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
This statement does not make any sense if in any case, we need to use
c.value
. Either we need to remove the condition or replace the condition as below:
$isActiveExpr = $connection->getCheckSql('c.value_id > 0', 'c.value', 'd.value');
Hence confirming the issue.
Thanks
Hello @engcom-Hotel
I am not sure we need to change results of the SQL query by we-self without discussing with product's owners or platform's architects. This logic is 12 years old and changes can provoke unexpected problem for a lot of projects after platform upgrade. I would propose remove this redundant condition. Anyway, you need to discuss it internally in Adobe (the jira issue already created). Let's do it.
Thank you in advance.
cc @maghamed
Hello @pmzandbergen,
Thanks for the report and collaboration!
We have verified the issue by looking into the codebase:
This statement does not make any sense if in any case, we need to use
c.value
. Either we need to remove the condition or replace the condition as below:
$isActiveExpr = $connection->getCheckSql('c.value_id > 0', 'c.value', 'd.value');
Hence confirming the issue.
Thanks
Hi @engcom-Hotel,
My PR is using a different condition (IS NULL
instead of > 0
) with a small but significant difference outcome:
c.value | d.value | > 0 | IS NULL | Comment |
---|---|---|---|---|
NULL | 0 | 0 | 0 | OK |
NULL | 1 | 1 | 1 | OK |
0 | 0 | 0 | 0 | OK |
0 | 1 | 1 | 0 | Unexpected result when using > 0 |
1 | 0 | 1 | 1 | OK |
1 | 1 | 1 | 1 | OK |
Please ensure the correct fix is used (see my PR @ https://github.com/magento/magento2/pull/38394 )
Bug The following condition is obviously invalid: https://github.com/magento/magento2/blob/03621bbcd75cbac4ffa8266a51aa2606980f4830/app/code/Magento/Catalog/Model/ResourceModel/Url.php#L415
Explanation The resulting query is:
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:
Should be changed to:
Note: This bug might not be affecting any Magento code (depends if the
is_active
flag is actually being used somewhere).