magento
magento copied to clipboard
If the field 'Brievenbuspakket gewicht' isn't filled in the configuration, no shipping options are shown
Plugin version
4.8.0
Magento version
2.4.5p1
PHP version
8.1
What went wrong?
When the field 'Brievenbuspakket gewicht' isn't filled in the configuration (no value in the input-field) there aren't any shipping options shown in the frontend en the error below is given in the logging.
Reproduction steps
- Navigate to ...
- Click on ...
- See ...
Relevant log output
main.CRITICAL: Exception: Deprecated Functionality: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in vendor/myparcelnl/magento/Model/Sales/Repository/PackageRepository.php on line 147 in vendor/magento/framework/App/ErrorHandler.php:62
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler()
#1 vendor/myparcelnl/magento/Model/Sales/Repository/PackageRepository.php(147): str_replace()
#2 vendor/myparcelnl/magento/Model/Quote/Checkout.php(66): MyParcelNL\Magento\Model\Sales\Repository\PackageRepository->setMailboxSettings()
#3 vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121): MyParcelNL\Magento\Model\Quote\Checkout->__construct()
#4 vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject()
#5 vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#6 vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#7 vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create()
#8 vendor/magento/framework/Interception/PluginList/PluginList.php(174): Magento\Framework\ObjectManager\ObjectManager->get()
#9 vendor/magento/framework/Interception/Interceptor.php(144): Magento\Framework\Interception\PluginList\PluginList->getPlugin()
#10 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Checkout\Block\Checkout\LayoutProcessor\Interceptor->Magento\Framework\Interception\{closure}()
#11 generated/code/Magento/Checkout/Block/Checkout/LayoutProcessor/Interceptor.php(23): Magento\Checkout\Block\Checkout\LayoutProcessor\Interceptor->___callPlugins()
#12 vendor/magento/module-checkout/Block/Onepage.php(81): Magento\Checkout\Block\Checkout\LayoutProcessor\Interceptor->process()
#13 var/view_preprocessed/pub/static/vendor/magento/module-checkout/view/frontend/templates/onepage.phtml(4): Magento\Checkout\Block\Onepage->getJsLayout()
#14 vendor/magento/framework/View/TemplateEngine/Php.php(71): include('...')
#15 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()
#16 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()
#17 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}()
#18 generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()
#19 vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()
#20 vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#21 vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Framework\View\Element\Template->_toHtml()
#22 vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#23 vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#24 vendor/magento/framework/View/Layout.php(578): Magento\Framework\View\Element\AbstractBlock->toHtml()
#25 vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock()
#26 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#27 vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#28 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#29 vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#30 vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#31 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#32 vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#33 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#34 vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#35 vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#36 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#37 vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#38 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#39 vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#40 vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#41 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#42 vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#43 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#44 vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#45 vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#46 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#47 vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#48 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#49 vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#50 vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#51 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#52 vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#53 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#54 vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement()
#55 vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer()
#56 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement()
#57 vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement()
#58 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement()
#59 vendor/magento/framework/View/Layout.php(975): Magento\Framework\View\Layout\Interceptor->renderElement()
#60 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout->getOutput()
#61 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Interceptor->___callParent()
#62 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}()
#63 generated/code/Magento/Framework/View/Layout/Interceptor.php(347): Magento\Framework\View\Layout\Interceptor->___callPlugins()
#64 vendor/magento/framework/View/Result/Page.php(260): Magento\Framework\View\Layout\Interceptor->getOutput()
#65 vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render()
#66 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult()
#67 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent()
#68 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}()
#69 generated/code/Magento/Framework/View/Result/Page/Interceptor.php(23): Magento\Framework\View\Result\Page\Interceptor->___callPlugins()
#70 vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult()
#71 vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#72 pub/index.php(60): Magento\Framework\App\Bootstrap->run()
#73 {main} [] []
Additional context
The solution is quite easy: make the field mandatory and show in the 'help-text' what options are avialable (by example '0' for a working brievenbuspakje).
Beside that, it looks to me that the test for null-value should/could be improved, because an optional field can have a NULL-value and the extension isn't handling them correctly right now.