Closed pjayramkumar closed 3 years ago
Hi @pjayramkumar. Thank you for your report. To help us process this issue please make sure that you provided the following information:
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:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @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, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento I am working on this
Hi @pjayramkumar! :wave:
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team
command to join Contributors team.
@magento add to contributors team
Hi @pjayramkumar! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.
@magento add to contributors team
i can confirm this behaviour
@magento I am working on this
@magento I am working on this
I can confirm this error on 2.4.0 and 2.4.1
Error introduced here https://github.com/magento/magento2/commit/70ede03e5c2dc9e2c3bb23d0fc5c29cb03cbe7dd
@magento I am working on this
@magento give me 2.4-develop instance
Hi @Morgy93. Thank you for your request. I'm working on Magento instance for you.
Hi @Morgy93, here is your Magento Instance: https://a068cefc821315523684f4ab4b839e24-2-4-develop.instances.magento-community.engineering Admin access: https://a068cefc821315523684f4ab4b839e24-2-4-develop.instances.magento-community.engineering/admin_d8d0 Login: 9a2db200 Password: 0f74394a9637
Hi @engcom-Bravo. 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:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
The issue is reproducible on 2.4-develop. Additional info from Engcom is added to the description
:white_check_mark: Confirmed by @engcom-Bravo
Thank you for verifying the issue. Based on the provided information internal tickets MC-38991
were created
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
@pjayramkumar I can confirm this error also in 2.4.2 when you open an order which was paid by paypal plus using an older version from I-ways paypal plus extension. In Magento 2.4.2 with the latest paypal plus extension everything works fine and there are no errors. I can open new orders without any issues. So, to fix the bug with older orders I tested your bugfix. After patching the files I could open all orders paid with paypal plus before the shop update. But when I wanted to open the invoice I got the following exception and I had a blank page with the exception hash
{"0":"Notice: Undefined index: id in \/var\/www\/vhosts\/SHOP\/httpdocs\/vendor\/magento\/module-tax\/Model\/ResourceModel\/Calculation.php on line 152","1":"#1 Magento\\Tax\\Model\\ResourceModel\\Calculation->getCalculationProcess() called at [vendor\/magento\/module-tax\/Model\/Calculation.php:648]\n#2 Magento\\Tax\\Model\\Calculation->reproduceProcess() called at [vendor\/magento\/module-sales\/Model\/Order\/Pdf\/Total\/DefaultTotal.php:110]\n#3 Magento\\Sales\\Model\\Order\\Pdf\\Total\\DefaultTotal->getFullTaxInfo() called at [vendor\/magento\/module-tax\/Model\/Sales\/Pdf\/Grandtotal.php:66]\n#4 Magento\\Tax\\Model\\Sales\\Pdf\\Grandtotal->getTotalsForDisplay() called at [vendor\/magento\/module-sales\/Model\/Order\/Pdf\/AbstractPdf.php:719]\n#5 Magento\\Sales\\Model\\Order\\Pdf\\AbstractPdf->insertTotals() called at [vendor\/magento\/module-sales\/Model\/Order\/Pdf\/Invoice.php:167]\n#6 Magento\\Sales\\Model\\Order\\Pdf\\Invoice->getPdf() called at [vendor\/magento\/module-sales\/Controller\/Adminhtml\/Invoice\/AbstractInvoice\/PrintAction.php:58]\n#7 Magento\\Sales\\Controller\\Adminhtml\\Invoice\\AbstractInvoice\\PrintAction->execute() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#8 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#9 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/App\/Action\/Plugin\/ActionFlagNoDispatchPlugin.php:51]\n#10 Magento\\Framework\\App\\Action\\Plugin\\ActionFlagNoDispatchPlugin->aroundExecute() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#11 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#12 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Sales\/Controller\/Adminhtml\/Order\/Invoice\/PrintAction\/Interceptor.php:23]\n#13 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->execute() called at [vendor\/magento\/framework\/App\/Action\/Action.php:111]\n#14 Magento\\Framework\\App\\Action\\Action->dispatch() called at [vendor\/magento\/module-backend\/App\/AbstractAction.php:151]\n#15 Magento\\Backend\\App\\AbstractAction->dispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#16 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#17 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/module-backend\/App\/Action\/Plugin\/Authentication.php:143]\n#18 Magento\\Backend\\App\\Action\\Plugin\\Authentication->aroundDispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#19 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#20 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Sales\/Controller\/Adminhtml\/Order\/Invoice\/PrintAction\/Interceptor.php:32]\n#21 Magento\\Sales\\Controller\\Adminhtml\\Order\\Invoice\\PrintAction\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/FrontController.php:186]\n#22 Magento\\Framework\\App\\FrontController->processRequest() called at [vendor\/magento\/framework\/App\/FrontController.php:118]\n#23 Magento\\Framework\\App\\FrontController->dispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#24 Magento\\Framework\\App\\FrontController\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#25 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#26 Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Framework\/App\/FrontController\/Interceptor.php:23]\n#27 Magento\\Framework\\App\\FrontController\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/Http.php:116]\n#28 Magento\\Framework\\App\\Http->launch() called at [vendor\/magento\/framework\/App\/Bootstrap.php:263]\n#29 Magento\\Framework\\App\\Bootstrap->run() called at [pub\/index.php:29]\n","url":"\/backend\/sales\/order_invoice\/print\/invoice_id\/3524\/key\/5f6f542f01786e87200031cdacb20cb895111e01117f952d95e3b8644c152fda\/","script_name":"\/pub\/index.php","report_id":"ed4a9d4df1673ea7a3ef338876eef0ade5a4fe9caf0dbb8e527e41330d50574b"}
I know it's just a notice but this notice crashes the backend.
Solution : (tested in Magento 2.4.2)
Path :vendor/magento/module-sales/view/adminhtml/templates/order/totals/tax.phtml Line 61
SOLUTION : Replace $rate->getId() with $rate['code']
@magento give me 2.4-develop instance
Hi @eduard13. Thank you for your request. I'm working on Magento instance for you.
Hi @eduard13, here is your Magento Instance: https://a068cefc821315523684f4ab4b839e24-2-4-develop.instances.magento-community.engineering Admin access: https://a068cefc821315523684f4ab4b839e24-2-4-develop.instances.magento-community.engineering/admin_5506 Login: abcd77f8 Password: 9e9429a00dad
@magento give me 2.4-develop instance
Hi @Morgy93. Thank you for your request. I'm working on Magento instance for you.
Hi @Morgy93, here is your Magento Instance: https://a068cefc821315523684f4ab4b839e24-2-4-develop.instances.magento-community.engineering Admin access: https://a068cefc821315523684f4ab4b839e24-2-4-develop.instances.magento-community.engineering/admin_d443 Login: 949432b7 Password: 81d470d2f891
Still reproducible~
Tried it for discussion here https://github.com/magento/magento2/pull/30516#issuecomment-822343010
Still reproducible~
Tried it for discussion here #30516 (comment)
Hm... I've reordered the order with a failing invoice and the invoice for a new one is correct.
Hm... I've reordered the order with a failing invoice and the invoice for a new one is correct.
The system went away for me just during my check😬
But I saw that $_fullInfo
was not populated for your invoice, so the problematic code was not even executed.
Having two items with different tax class should work (or not work in this case 😅) for example 19% and 7% tax (like in Germany)
@magento give me 2.4-develop instance
Hi @Morgy93. Thank you for your request. I'm working on Magento instance for you.
Hi @Morgy93, here is your Magento Instance: https://a068cefc821315523684f4ab4b839e24-2-4-develop.instances.magento-community.engineering Admin access: https://a068cefc821315523684f4ab4b839e24-2-4-develop.instances.magento-community.engineering/admin_75f4 Login: 73c73a03 Password: 607004eaaf0c
Hi @pjayramkumar, @Morgy93.
Thank you for your report and collaboration!
The related internal Jira ticket MC-38991
was closed as non-reproducible
in 2.4-develop
.
It means that Magento team either unable to reproduce this issue using provided Steps to Reproduce from the Description section on clean Magento instance or the issue has been already fixed in the scope of other tasks.
But if you still run into this problem please update or provide additional information/steps/preconditions in the Description section and reopen this issue.
@magento Hello everyone
This issue is reproducible for my site We have free products on the site If all products in an order are free, then we apply free shipping and billing methods and don't have tax for the order In this case we create an invoice manually from the admin page and have the issue when we try to visit the invoice page
A little update related to this issue As I investigated the reason of the issue is that we load taxes by invoice ID instead of expected order ID As I see in this case we always expect an order ID hire Please let me know if invoice ID is also right vendor/magento/module-sales/Block/Adminhtml/Order/Totals/Tax.php:98
This issue is reproducible for my site We have free products on the site If all products in an order are free, then we apply free shipping and billing methods and don't have tax for the order In this case we create an invoice manually from the admin page and have the issue when we try to visit the invoice page
Hello, @EgorDubrovskiy. Thanks for the update! Unfortunately, I was unable to reproduce this issue with the information you have provided. Can you please give more detailed steps to reproduce?
I fixed it temporarily by adding
<?php $ratesId = preg_replace("/[^a-zA-Z]+/", "", $rate['code']); ?>
replaced Line 62 with
<tr id="rate-<?= /* @noEscape */ $ratesId ?>"
and replaced Line 77
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display:none;", 'tr#rate-' . $ratesId ) ?>
in file: vendor/magento/module-sales/view/adminhtml/templates/order/totals/tax.phtml
print_r($_fullInfo); returns
Array
(
[0] => Array
(
[amount] => 2.6400
[base_amount] => 2.6400
[base_real_amount] => 2.6400
[rates] => Array
(
[0] => Array
(
[code] => DE - reduzierte USt.
[title] => reduzierte USt.
[percent] => 7
[position] => 0
[priority] => 0
)
)
[percent] => 7
[id] => DE - reduzierte USt.
)
)
I can repoduce this exact same issue on my site M2.4.2 if I set Display ull tax summary to YES. Set to NO, there is no error.
Here is the error on the source page
<tr id="rate-Error: Call to a member function getId() on array in /home/m2/public_html/vendor/magento/module-sales/view/adminhtml/templates/order/totals/tax.phtml:62
Stack trace:
:white_check_mark: Confirmed by @mrtuvn
Thank you for verifying the issue. Based on the provided information internal tickets MC-38991
were created
Issue Available: @mrtuvn, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
It looks like core Magento devs have finally seen the light even though the community had a PR open for this for almost a year now. So they just publised a fix in: MC-42332: part 1, part 2
I'm guessing it will be released in Magento 2.4.4 which will probably be released somewhere in 2022, yay!
Hi @pjayramkumar, As @hostep mentioned, looks like the issue was fixed in the 2.4-develop branch with the following commits:
Could you confirm that?
Issue was fixed and delivered in pull request as was mentioned above
This issue was fixed with the following commits: d648bdc
, 3ae814c
. Closing this issue
It looks like core Magento devs have finally seen the light even though the community had a PR open for this for almost a year now. So they just publised a fix in: MC-42332: part 1, part 2
I'm guessing it will be released in Magento 2.4.4 which will probably be released somewhere in 2022, yay!
hopefully this will fix my issue tooo yay :-) thank you for that
Two years later... bug still present in Magento 2.4.5
@jaykobi, accodring to the following line, it shouldn't reproduce on 2.4.5. https://github.com/magento/magento2/blob/d648bdc238ba6b59890694251655f725ad1b5d88/app/code/Magento/Sales/view/adminhtml/templates/order/totals/tax.phtml#L63 If you can reproduce this issue on clean magento installation, please report a separate issue for that.
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
4.
need to expand this array and add id as key to get in the result to the Magento\Tax\Model\ResourceModel\Calculation
add the ID CONST in the Magento\Tax\Model\Sales\Order\Tax class
Actual result (*)
Additional info from Engcom
Switch Magento into Developer mode to reproduce the issue
bin/magento dep:mo:set developer
The invoice looks like thisError from View Page Source