-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Magento erroneously assums one category is parent of another based on category path #32464
Comments
Hi @dot319. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
I confirmed this issue on my local vanilla Magento environment. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions! |
This shouldn't have been closed, it sounds valid at first sight. @Den4ik or @ihor-sviziev, can we get somebody to verify this first before it gets closed without any attention? Thanks! |
@gabrieldagama, feels like it should be prioritized as P1 or P2 |
Hi @engcom-Alfa. Thank you for working on this issue.
|
@magento give me 2.4-develop instance |
Hi @engcom-Alfa. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Alfa, here is your Magento Instance: https://171e8312267191937caf5aef6f656573-2-4-develop.instances.magento-community.engineering |
…nother based on category path - Update Unit test to reproduce issue - Fix check for parent category path
…nother based on category path - Update Unit test to reproduce issue - Fix check for parent category path
…nother based on category path - Update Unit test to reproduce issue - Fix check for parent category path
Preconditions (*)
For example:
Example Screenshot
Steps to reproduce (*)
Ex: We can call move method inside the new simple model controller class created as like below code:
Expected result (*)
Actual result (*)
This happens because in the method \Magento\Catalog\Model\CategoryManagement::move there exists the assumption that if strpos($parentPath, $path) === 0, the category you are trying to move is a parent of the category you are trying to move it into. While actually in this case they are 'siblings', their paths are '1/2/14' and '1/2/146'.
Below is the complete report log generated:
{
"0": "Operation do not allow to move a parent category to any of children category",
"1": "#1 Mks\Helloworld\Controller\Index\Index->execute() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:58]\n#2 Mks\Helloworld\Controller\Index\Index\Interceptor->___callParent() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:138]\n#3 Mks\Helloworld\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:153]\n#4 Mks\Helloworld\Controller\Index\Index\Interceptor->___callPlugins() called at [generated\code\Mks\Helloworld\Controller\Index\Index\Interceptor.php:23]\n#5 Mks\Helloworld\Controller\Index\Index\Interceptor->execute() called at [lib\internal\Magento\Framework\App\Action\Action.php:111]\n#6 Magento\Framework\App\Action\Action->dispatch() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:58]\n#7 Mks\Helloworld\Controller\Index\Index\Interceptor->___callParent() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:138]\n#8 Mks\Helloworld\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:153]\n#9 Mks\Helloworld\Controller\Index\Index\Interceptor->___callPlugins() called at [generated\code\Mks\Helloworld\Controller\Index\Index\Interceptor.php:32]\n#10 Mks\Helloworld\Controller\Index\Index\Interceptor->dispatch() called at [lib\internal\Magento\Framework\App\FrontController.php:245]\n#11 Magento\Framework\App\FrontController->getActionResponse() called at [lib\internal\Magento\Framework\App\FrontController.php:212]\n#12 Magento\Framework\App\FrontController->processRequest() called at [lib\internal\Magento\Framework\App\FrontController.php:147]\n#13 Magento\Framework\App\FrontController->dispatch() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:58]\n#14 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:138]\n#15 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [app\code\Magento\Store\App\FrontController\Plugin\RequestPreprocessor.php:99]\n#16 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:135]\n#17 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [app\code\Magento\PageCache\Model\App\FrontController\BuiltinPlugin.php:75]\n#18 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:135]\n#19 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [lib\internal\Magento\Framework\Interception\Interceptor.php:153]\n#20 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated\code\Magento\Framework\App\FrontController\Interceptor.php:23]\n#21 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [lib\internal\Magento\Framework\App\Http.php:116]\n#22 Magento\Framework\App\Http->launch() called at [generated\code\Magento\Framework\App\Http\Interceptor.php:23]\n#23 Magento\Framework\App\Http\Interceptor->launch() called at [lib\internal\Magento\Framework\App\Bootstrap.php:264]\n#24 Magento\Framework\App\Bootstrap->run() called at [pub\index.php:29]\n",
"url": "/Mks/Index/Index",
"script_name": "/index.php",
"report_id": "876d49429e34c918d1163ad0b48fb02baab92e59889dec335691fc4e0b137805"
}
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: