Skip to content
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

Fatal Error when refunding a product that has been removed. #38588

Closed
5 tasks
SamJUK opened this issue Apr 8, 2024 · 5 comments
Closed
5 tasks

Fatal Error when refunding a product that has been removed. #38588

SamJUK opened this issue Apr 8, 2024 · 5 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.5-p3 Indicates original Magento version for the Issue report.

Comments

@SamJUK
Copy link

SamJUK commented Apr 8, 2024

Preconditions and environment

  • 2.4.5-p3

Steps to reproduce

  • Place a order for a configurable product variation
  • Invoice + Ship
  • Delete the variation
  • Attempt to issue a new credit memo for the invoice

Expected result

Credit memo creates successfully

Actual result

Blank page of text with a fatal exception
Stack Trace Excerpt

[2024-04-05T13:10:03.541722+00:00] main.CRITICAL: TypeError: Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor::execute(): Argument #1 ($productType) must be of type string, null given, called in /vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php on line 108 and defined in /generated/code/Magento/InventoryConfiguration/Model/IsSourceItemManagementAllowedForProductType/Interceptor.php:20
Stack trace:
#0 /vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(108): Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor->execute()
#1 /vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(75): Magento\InventorySales\Model\GetProductSalableQty->validateProductType()
#2 /vendor/magento/module-inventory-sales-admin-ui/Model/GetSalableQuantityDataBySku.php(105): Magento\InventorySales\Model\GetProductSalableQty->execute()
#3 /vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(95): Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku->execute()
#4 /vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(66): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->getProductStockIds()
#5 /vendor/magento/module-inventory-sales-admin-ui/Plugin/Sales/Block/Items/Renderer/DefaultRenderer/ChildManageStockIsOn.php(59): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->execute()
#6 /vendor/magento/framework/Interception/Interceptor.php(146): Magento\InventorySalesAdminUi\Plugin\Sales\Block\Items\Renderer\DefaultRenderer\ChildManageStockIsOn->afterCanReturnItemToStock()
#7 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->Magento\Framework\Interception\{closure}()
#8 /generated/code/Magento/Sales/Block/Adminhtml/Items/Renderer/DefaultRenderer/Interceptor.php(23): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->___callPlugins()
#9 /var/view_preprocessed/pub/static/vendor/magento/module-sales/view/adminhtml/templates/order/creditmemo/create/items/renderer/default.phtml(1): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->canReturnItemToStock()

Additional information

Another reported occurrence: #38062 (comment)

Full stack trace

[2024-03-26T12:43:54.114874+00:00] main.CRITICAL: TypeError: Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor::execute(): Argument #1 ($productType) must be of type string, null given, called in /site/vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php on line 108 and defined in /site/generated/code/Magento/InventoryConfiguration/Model/IsSourceItemManagementAllowedForProductType/Interceptor.php:20
Stack trace:
#0 /site/vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(108): Magento\InventoryConfiguration\Model\IsSourceItemManagementAllowedForProductType\Interceptor->execute()
#1 /site/vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php(75): Magento\InventorySales\Model\GetProductSalableQty->validateProductType()
#2 /site/vendor/magento/module-inventory-sales-admin-ui/Model/GetSalableQuantityDataBySku.php(105): Magento\InventorySales\Model\GetProductSalableQty->execute()
#3 /site/vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(95): Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku->execute()
#4 /site/vendor/magento/module-inventory-sales-admin-ui/Model/GetIsManageStockForProduct.php(66): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->getProductStockIds()
#5 /site/vendor/magento/module-inventory-sales-admin-ui/Plugin/Sales/Block/Items/Renderer/DefaultRenderer/ChildManageStockIsOn.php(59): Magento\InventorySalesAdminUi\Model\GetIsManageStockForProduct->execute()
#6 /site/vendor/magento/framework/Interception/Interceptor.php(146): Magento\InventorySalesAdminUi\Plugin\Sales\Block\Items\Renderer\DefaultRenderer\ChildManageStockIsOn->afterCanReturnItemToStock()
#7 /site/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->Magento\Framework\Interception\{closure}()
#8 /site/generated/code/Magento/Sales/Block/Adminhtml/Items/Renderer/DefaultRenderer/Interceptor.php(23): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->___callPlugins()
#9 /site/var/view_preprocessed/pub/static/vendor/magento/module-sales/view/adminhtml/templates/order/creditmemo/create/items/renderer/default.phtml(1): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->canReturnItemToStock()
#10 /site/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('...')
#11 /site/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()
#12 /site/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()
#13 /site/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}()
#14 /site/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()
#15 /site/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()
#16 /site/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#17 /site/vendor/magento/module-backend/Block/Template.php(141): Magento\Framework\View\Element\Template->_toHtml()
#18 /site/vendor/magento/framework/View/Element/AbstractBlock.php(1117): Magento\Backend\Block\Template->_toHtml()
#19 /site/vendor/magento/framework/View/Element/AbstractBlock.php(1121): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#20 /site/vendor/magento/framework/View/Element/AbstractBlock.php(670): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#21 /site/generated/code/Magento/Sales/Block/Adminhtml/Items/Renderer/DefaultRenderer/Interceptor.php(32): Magento\Framework\View\Element\AbstractBlock->toHtml()
#22 /site/vendor/magento/module-sales/Block/Adminhtml/Items/AbstractItems.php(148): Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer\Interceptor->toHtml()
#23 /site/var/view_preprocessed/pub/static/vendor/magento/module-sales/view/adminhtml/templates/order/creditmemo/create/items.phtml(1): Magento\Sales\Block\Adminhtml\Items\AbstractItems->getItemHtml()
#24 /site/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('...')
#25 /site/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()
#26 /site/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()
#27 /site/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}()
#28 /site/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()
#29 /site/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()
#30 /site/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#31 /site/vendor/magento/module-backend/Block/Template.php(141): Magento\Framework\View\Element\Template->_toHtml()
#32 /site/vendor/magento/framework/View/Element/AbstractBlock.php(1117): Magento\Backend\Block\Template->_toHtml()
#33 /site/vendor/magento/framework/View/Element/AbstractBlock.php(1121): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#34 /site/vendor/magento/framework/View/Element/AbstractBlock.php(670): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#35 /site/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Element\AbstractBlock->toHtml()
#36 /site/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items\Interceptor->___callParent()
#37 /site/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items\Interceptor->Magento\Framework\Interception\{closure}()
#38 /site/generated/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items/Interceptor.php(23): Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items\Interceptor->___callPlugins()
#39 /site/vendor/magento/framework/View/Layout.php(578): Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items\Interceptor->toHtml()
#40 /site/vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock()
#41 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#42 /site/vendor/magento/framework/View/Element/AbstractBlock.php(517): Magento\Framework\View\Layout->renderElement()
#43 /site/var/view_preprocessed/pub/static/vendor/magento/module-sales/view/adminhtml/templates/order/creditmemo/create/form.phtml(1): Magento\Framework\View\Element\AbstractBlock->getChildHtml()
#44 /site/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('...')
#45 /site/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()
#46 /site/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()
#47 /site/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}()
#48 /site/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()
#49 /site/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()
#50 /site/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#51 /site/vendor/magento/module-backend/Block/Template.php(141): Magento\Framework\View\Element\Template->_toHtml()
#52 /site/vendor/magento/framework/View/Element/AbstractBlock.php(1117): Magento\Backend\Block\Template->_toHtml()
#53 /site/vendor/magento/framework/View/Element/AbstractBlock.php(1121): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#54 /site/vendor/magento/framework/View/Element/AbstractBlock.php(670): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#55 /site/generated/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Form/Interceptor.php(23): Magento\Framework\View\Element\AbstractBlock->toHtml()
#56 /site/vendor/magento/framework/View/Layout.php(578): Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Form\Interceptor->toHtml()
#57 /site/vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock()
#58 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#59 /site/vendor/magento/framework/View/Element/AbstractBlock.php(517): Magento\Framework\View\Layout->renderElement()
#60 /site/vendor/magento/module-backend/Block/Widget/Form/Container.php(220): Magento\Framework\View\Element\AbstractBlock->getChildHtml()
#61 /site/var/view_preprocessed/pub/static/vendor/magento/module-backend/view/adminhtml/templates/widget/form/container.phtml(1): Magento\Backend\Block\Widget\Form\Container->getFormHtml()
#62 /site/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('...')
#63 /site/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()
#64 /site/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()
#65 /site/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}()
#66 /site/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()
#67 /site/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()
#68 /site/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#69 /site/vendor/magento/module-backend/Block/Template.php(141): Magento\Framework\View\Element\Template->_toHtml()
#70 /site/vendor/magento/framework/View/Element/AbstractBlock.php(1117): Magento\Backend\Block\Template->_toHtml()
#71 /site/vendor/magento/framework/View/Element/AbstractBlock.php(1121): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#72 /site/vendor/magento/framework/View/Element/AbstractBlock.php(670): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#73 /site/generated/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Interceptor.php(23): Magento\Framework\View\Element\AbstractBlock->toHtml()
#74 /site/vendor/magento/framework/View/Layout.php(578): Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Interceptor->toHtml()
#75 /site/vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock()
#76 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#77 /site/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#78 /site/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#79 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#80 /site/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#81 /site/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#82 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#83 /site/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#84 /site/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#85 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#86 /site/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#87 /site/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#88 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#89 /site/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#90 /site/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#91 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#92 /site/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#93 /site/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#94 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#95 /site/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#96 /site/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#97 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#98 /site/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement()
#99 /site/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#100 /site/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#101 /site/vendor/magento/framework/View/Layout.php(975): Magento\Framework\View\Layout->renderElement()
#102 /site/generated/code/Magento/Framework/View/Layout/Interceptor.php(41): Magento\Framework\View\Layout->getOutput()
#103 /site/vendor/magento/framework/View/Result/Page.php(260): Magento\Framework\View\Layout\Interceptor->getOutput()
#104 /site/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render()
#105 /site/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(32): Magento\Framework\View\Result\Layout->renderResult()
#106 /site/vendor/magento/framework/App/Http.php(120): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult()
#107 /site/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#108 /site/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#109 {main} [] []

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Apr 8, 2024

Hi @SamJUK. 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:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 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, join the Community Contributions Triage session to discuss the appropriate ticket.

Copy link

m2-assistant bot commented Apr 8, 2024

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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- 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.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.5-p3 Indicates original Magento version for the Issue report. label Apr 8, 2024
@SamJUK
Copy link
Author

SamJUK commented Apr 9, 2024

Looking through the 2.4.7 release notes, is appears this may already be solved. Not sure on the potential is of back porting to older version.

@engcom-Bravo
Copy link
Contributor

Hi @SamJUK,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the attached video.

Steps to reproduce

  • Place a order for a configurable product variation
  • Invoice + Ship
  • Delete the variation
  • Attempt to issue a new credit memo for the invoice
Screen.Recording.2024-04-10.at.15.29.10.mov

We are able to create the creditmemo successfully.

It is recommend to verify the issues in Latest 2.4-develop instance and it might be possible issue has been addressed and fixed in Latest version.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Apr 10, 2024
@SamJUK
Copy link
Author

SamJUK commented Apr 10, 2024

It was indeed fixed in 2.4.7. Relevant commit can be found here to patch older versions
magento/inventory@78eb154

@SamJUK SamJUK closed this as completed Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.5-p3 Indicates original Magento version for the Issue report.
Projects
None yet
Development

No branches or pull requests

2 participants