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

Argument #1 ($storeId) must be of type int, string given #11

Closed
simonmaass opened this issue Jun 16, 2023 · 5 comments
Closed

Argument #1 ($storeId) must be of type int, string given #11

simonmaass opened this issue Jun 16, 2023 · 5 comments

Comments

@simonmaass
Copy link

We are using the mollie magento 2 module (https://github.com/mollie/magento2/) and when clicking "mark as paid" button we get the following error:

TypeError: Dhl\Paket\Model\AdditionalFee\AdditionalFeeProvider::getAmounts(): Argument netresearch/dhl-shipping-m2#1 ($storeId) must be of type int, string given, called in vendor/dhl/module-carrier-paket/Model/AdditionalFee/AdditionalFeeConfiguration.php on line 46 and defined in vendor/dhl/module-carrier-paket/Model/AdditionalFee/AdditionalFeeProvider.php:27
Stack trace:
#0 vendor/dhl/module-carrier-paket/Model/AdditionalFee/AdditionalFeeConfiguration.php(46): Dhl\Paket\Model\AdditionalFee\AdditionalFeeProvider->getAmounts('1')
netresearch/dhl-shipping-m2#1 vendor/dhl/module-carrier-paket/Model/AdditionalFee/AdditionalFeeConfiguration.php(83): Dhl\Paket\Model\AdditionalFee\AdditionalFeeConfiguration->calculateAdjustmentAmount(Object(Magento\Quote\Model\Quote\Interceptor))
netresearch/dhl-shipping-m2#2 vendor/netresearch/module-shipping-core/Model/AdditionalFee/AdditionalFeeManagement.php(46): Dhl\Paket\Model\AdditionalFee\AdditionalFeeConfiguration->isActive(Object(Magento\Quote\Model\Quote\Interceptor))
netresearch/dhl-shipping-m2#3 vendor/netresearch/module-shipping-core/Model/AdditionalFee/Total.php(109): Netresearch\ShippingCore\Model\AdditionalFee\AdditionalFeeManagement->isActive(Object(Magento\Quote\Model\Quote\Interceptor))
netresearch/dhl-shipping-m2#4 vendor/magento/module-quote/Model/Quote/TotalsCollector.php(261): Netresearch\ShippingCore\Model\AdditionalFee\Total->collect(Object(Magento\Quote\Model\Quote\Interceptor), Object(Magento\Quote\Model\ShippingAssignment), Object(Magento\Quote\Model\Quote\Address\Total))
netresearch/dhl-shipping-m2#5 vendor/magento/module-quote/Model/Quote/TotalsCollector.php(156): Magento\Quote\Model\Quote\TotalsCollector->collectAddressTotals(Object(Magento\Quote\Model\Quote\Interceptor), Object(Magento\Quote\Model\Quote\Address))
netresearch/dhl-shipping-m2#6 vendor/magento/module-quote/Model/Quote.php(2021): Magento\Quote\Model\Quote\TotalsCollector->collect(Object(Magento\Quote\Model\Quote\Interceptor))
netresearch/dhl-shipping-m2#7 generated/code/Magento/Quote/Model/Quote/Interceptor.php(743): Magento\Quote\Model\Quote->collectTotals()
netresearch/dhl-shipping-m2#8 vendor/magento/module-sales/Model/AdminOrder/Create.php(1634): Magento\Quote\Model\Quote\Interceptor->collectTotals()
netresearch/dhl-shipping-m2#9 vendor/magento/module-sales/Model/AdminOrder/Create.php(1622): Magento\Sales\Model\AdminOrder\Create->collectRates()
netresearch/dhl-shipping-m2#10 vendor/magento/module-sales/Model/AdminOrder/Create.php(596): Magento\Sales\Model\AdminOrder\Create->collectShippingRates()
netresearch/dhl-shipping-m2#11 vendor/mollie/magento2/Service/Order/Reorder.php(160): Magento\Sales\Model\AdminOrder\Create->initFromOrder(Object(Magento\Sales\Model\Order\Interceptor))
netresearch/dhl-shipping-m2#12 vendor/mollie/magento2/Service/Order/Reorder.php(125): Mollie\Payment\Service\Order\Reorder->recreate(Object(Magento\Sales\Model\Order\Interceptor))
netresearch/dhl-module-ui#6 vendor/mollie/magento2/Controller/Adminhtml/Action/MarkAsPaid.php(59): Mollie\Payment\Service\Order\Reorder->createAndInvoice(Object(Magento\Sales\Model\Order\Interceptor))
netresearch/dhl-shipping-m2#14 vendor/magento/framework/Interception/Interceptor.php(58): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid->execute()
netresearch/dhl-module-ui#4 vendor/magento/framework/Interception/Interceptor.php(138): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor->___callParent('execute', Array)
netresearch/dhl-shipping-m2#16 vendor/magento/framework/Interception/Interceptor.php(153): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor->Magento\Framework\Interception\{closure}()
netresearch/dhl-shipping-m2#17 generated/code/Mollie/Payment/Controller/Adminhtml/Action/MarkAsPaid/Interceptor.php(23): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor->___callPlugins('execute', Array, Array)
netresearch/dhl-shipping-m2#18 vendor/magento/framework/App/Action/Action.php(111): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor->execute()
netresearch/dhl-shipping-m2#19 vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
netresearch/dhl-shipping-m2#20 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
netresearch/dhl-shipping-m2#21 vendor/magento/framework/Interception/Interceptor.php(138): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor->___callParent('dispatch', Array)
netresearch/dhl-shipping-m2#22 vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
netresearch/dhl-shipping-m2#23 vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
netresearch/dhl-shipping-m2#24 vendor/magento/framework/Interception/Interceptor.php(153): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
netresearch/dhl-shipping-m2#25 generated/code/Mollie/Payment/Controller/Adminhtml/Action/MarkAsPaid/Interceptor.php(32): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor->___callPlugins('dispatch', Array, Array)
#26 vendor/magento/framework/App/FrontController.php(245): Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
netresearch/dhl-shipping-m2#27 vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse(Object(Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor), Object(Magento\Framework\App\Request\Http))
netresearch/dhl-module-carrier-paket#2 vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest(Object(Magento\Framework\App\Request\Http), Object(Mollie\Payment\Controller\Adminhtml\Action\MarkAsPaid\Interceptor))
netresearch/dhl-shipping-m2#29 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
netresearch/dhl-shipping-m2#30 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
netresearch/dhl-shipping-m2#31 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
netresearch/dhl-shipping-m2#32 generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
netresearch/module-shipping-core#3 vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
netresearch/module-shipping-ui#1 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->launch()
netresearch/dhl-shipping-m2#35 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\Http\Interceptor->___callParent('launch', Array)
netresearch/dhl-shipping-m2#36 vendor/justbetter/magento2-sentry/Plugin/GlobalExceptionCatcher.php(89): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
netresearch/deutschepost-module-internetmarke#1 vendor/magento/framework/Interception/Interceptor.php(135): JustBetter\Sentry\Plugin\GlobalExceptionCatcher->aroundLaunch(Object(Magento\Framework\App\Http\Interceptor), Object(Closure))
netresearch/dhl-shipping-m2#38 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
netresearch/dhl-shipping-m2#39 generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->___callPlugins('launch', Array, NULL)
netresearch/dhl-shipping-m2#40 vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
netresearch/dhl-shipping-m2#41 pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
netresearch/dhl-module-carrier-paket#7 {main}
@mam08ixo mam08ixo transferred this issue from netresearch/dhl-shipping-m2 Jun 16, 2023
@mam08ixo
Copy link
Contributor

Hi @simonmaass, thank you for bringing this to our attention.

It looks like a type cast will solve the issue where the quote's store ID does not conform to the annotated type.

$fees = $this->feeProvider->getAmounts($quote->getStoreId());

A fix will be included with the next release.

@simonmaass
Copy link
Author

simonmaass commented Jun 16, 2023

hey @mam08ixo ! thank you for the quick reply! any planned release date?

@mam08ixo
Copy link
Contributor

The next release of the DHL Shipping extension with updated dependencies is planned for beginning of July.

@simonmaass
Copy link
Author

thank you for the info!

@mam08ixo
Copy link
Contributor

mam08ixo commented Jul 17, 2023

Type casting was added in version 2.8.0 of the carrier module. The new extension version is available via packagist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants