Error when activating the module

Created on 21 April 2023, over 1 year ago
Updated 24 April 2023, over 1 year ago

Installing and activating Econt Shipping

We have installed and activated the dev version of the module

Working environment Core 9.5.8 and commerce 8.x-2.32, PHP 7.4
The module options do work in the administrative interface.
We have set the default country, free delivery city and base Econt tax.

When visiting the shipping step on the checkout we receive this error:
Error: Call to a member function getPlugin() on null in Drupal\commerce_econt\Plugin\Commerce\ShippingMethod\Econt->calculateRates() (line 362 of /modules/contrib/commerce_econt/src/Plugin/Commerce/ShippingMethod/Econt.php)

#0 /modules/contrib/commerce_shipping/src/ShipmentManager.php(89): Drupal\commerce_econt\Plugin\Commerce\ShippingMethod\Econt->calculateRates()
#1 /modules/contrib/commerce_shipping/src/Plugin/Field/FieldWidget/ShippingRateWidget.php(100): Drupal\commerce_shipping\ShipmentManager->calculateRates()
#2 /core/lib/Drupal/Core/Field/WidgetBase.php(353): Drupal\commerce_shipping\Plugin\Field\FieldWidget\ShippingRateWidget->formElement()
#3 /core/lib/Drupal/Core/Field/WidgetBase.php(220): Drupal\Core\Field\WidgetBase->formSingleElement()
#4 /core/lib/Drupal/Core/Field/WidgetBase.php(111): Drupal\Core\Field\WidgetBase->formMultipleElements()
#5 /core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(183): Drupal\Core\Field\WidgetBase->form()
#6 /modules/contrib/commerce_shipping/src/Plugin/Commerce/CheckoutPane/ShippingInformation.php(335): Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm()
#7 /modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowWithPanesBase.php(546): Drupal\commerce_shipping\Plugin\Commerce\CheckoutPane\ShippingInformation->buildPaneForm()
#8 [internal function]: Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase->buildForm()
#9 /core/lib/Drupal/Core/Form/FormBuilder.php(534): call_user_func_array()
#10 /core/lib/Drupal/Core/Form/FormBuilder.php(281): Drupal\Core\Form\FormBuilder->retrieveForm()
#11 /core/lib/Drupal/Core/Form/FormBuilder.php(222): Drupal\Core\Form\FormBuilder->buildForm()
#12 /modules/contrib/commerce/modules/checkout/src/Controller/CheckoutController.php(143): Drupal\Core\Form\FormBuilder->getForm()
#13 [internal function]: Drupal\commerce_checkout\Controller\CheckoutController->formPage()
#14 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#15 /core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#17 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#18 /vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#19 /vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#20 /core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#21 /core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#22 /core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#23 /core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#24 /core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#25 /core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#26 /vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#27 /core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#28 /index.php(19): Drupal\Core\DrupalKernel->handle()
#29 {main}

Could you please assist us making the module work?

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇬Bulgaria joro78

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @joro78
  • 🇧🇬Bulgaria a.sotirov

    @joro78
    I'm planning to make complete refactoring of this module in the next few weeks. So this one will be also fixed.
    Thanks a lot for you report.

  • 🇧🇬Bulgaria joro78

    Thanks for you answer @a.sotirov

    We have installed the dev module on another site. We've enabled the test mode and set options as the example above.

    The cart page opens, but econt delivery form is unavailable, and we receive other errors:

    1) Местоположение /checkout/176/order_information?_wrapper_format=drupal_ajax&ajax_form=1
    URL референт /checkout/176/order_information
    Съобщение Exception occurred when calculating rates for Econt test: The provided value "" is not a numeric value.

    2) Notice: Trying to get property 'total' of non-object in commerce_econt_send_request_xml() (line 461 of /modules/contrib/commerce_econt/commerce_econt.module)

    #0 /core/includes/bootstrap.inc(347): _drupal_error_handler_real()
    #1 /modules/contrib/commerce_econt/commerce_econt.module(461): _drupal_error_handler()
    #2 /modules/contrib/commerce_econt/src/Plugin/Commerce/ShippingMethod/Econt.php(372): commerce_econt_send_request_xml()
    #3 /modules/contrib/commerce_shipping/src/ShipmentManager.php(89): Drupal\commerce_econt\Plugin\Commerce\ShippingMethod\Econt->calculateRates()
    #4 /modules/contrib/commerce_shipping/src/Plugin/Field/FieldWidget/ShippingRateWidget.php(100): Drupal\commerce_shipping\ShipmentManager->calculateRates()
    #5 /core/lib/Drupal/Core/Field/WidgetBase.php(353): Drupal\commerce_shipping\Plugin\Field\FieldWidget\ShippingRateWidget->formElement()
    #6 /core/lib/Drupal/Core/Field/WidgetBase.php(220): Drupal\Core\Field\WidgetBase->formSingleElement()
    #7 /core/lib/Drupal/Core/Field/WidgetBase.php(111): Drupal\Core\Field\WidgetBase->formMultipleElements()
    #8 /core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(183): Drupal\Core\Field\WidgetBase->form()
    #9 /modules/contrib/commerce_shipping/src/Plugin/Commerce/CheckoutPane/ShippingInformation.php(335): Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm()
    #10 /modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowWithPanesBase.php(546): Drupal\commerce_shipping\Plugin\Commerce\CheckoutPane\ShippingInformation->buildPaneForm()
    #11 [internal function]: Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase->buildForm()
    #12 /core/lib/Drupal/Core/Form/FormBuilder.php(534): call_user_func_array()
    #13 /core/lib/Drupal/Core/Form/FormBuilder.php(281): Drupal\Core\Form\FormBuilder->retrieveForm()
    #14 /core/lib/Drupal/Core/Form/FormBuilder.php(222): Drupal\Core\Form\FormBuilder->buildForm()
    #15 /modules/contrib/commerce/modules/checkout/src/Controller/CheckoutController.php(143): Drupal\Core\Form\FormBuilder->getForm()
    #16 [internal function]: Drupal\commerce_checkout\Controller\CheckoutController->formPage()
    #17 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
    #18 /core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #19 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
    #20 /core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
    #21 /vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #22 /vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #23 /core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
    #24 /core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #25 /core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #26 /core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
    #27 /core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
    #28 /core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #29 /vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #30 /core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
    #31 /index.php(19): Drupal\Core\DrupalKernel->handle()
    #32 {main}

    We, and I suppose the Drupal community in Bulgaria, shall really be happy using this module =)

    Successful work!

Production build 0.71.5 2024