- Issue created by @sketman
- 🇮🇱Israel jsacksick
Sounds like a commerce_license issue, not Commerce. Commerce refuses an invalid interval specified which is "valid". Would be great if you could post the backtrace so we can figure out what code is instantiating the interval.
- 🇸🇰Slovakia sketman
@jsacksick Thank you for response
Please find below the backtrace logs:#0 /home/website/public_html/web/modules/contrib/commerce_license/src/Entity/License.php(550): Drupal\commerce\Interval->__construct() #1 /home/website/public_html/web/modules/contrib/commerce_license/src/EventSubscriber/LicenseRenewalCartEventSubscriber.php(105): Drupal\commerce_license\Entity\License->canRenew() #2 [internal function]: Drupal\commerce_license\EventSubscriber\LicenseRenewalCartEventSubscriber->onCartEntityAdd() #3 /home/website/public_html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func() #4 /home/website/public_html/web/modules/contrib/commerce/modules/cart/src/CartManager.php(126): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() #5 /home/website/public_html/web/modules/contrib/commerce_add_to_cart_link/src/Controller/AddToCartController.php(168): Drupal\commerce_cart\CartManager->addOrderItem() #6 [internal function]: Drupal\commerce_add_to_cart_link\Controller\AddToCartController->action() #7 /home/website/public_html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array() #8 /home/website/public_html/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #9 /home/website/public_html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext() #10 /home/website/public_html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() #11 /home/website/public_html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #12 /home/website/public_html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw() #13 /home/website/public_html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle() #14 /home/website/public_html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle() #15 /home/website/public_html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle() #16 /home/website/public_html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass() #17 /home/website/public_html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle() #18 /home/website/public_html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() #19 /home/website/public_html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() #20 /home/website/public_html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle() #21 /home/website/public_html/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle() #22 /home/website/public_html/web/index.php(19): Drupal\Core\DrupalKernel->handle() #23 {main}
The website encountered an unexpected error. Try again later. InvalidArgumentException: Invalid interval unit "mesiace" provided. in Drupal\commerce\Interval->__construct() (line 39 of modules/contrib/commerce/src/Interval.php). Drupal\commerce_license\Entity\License->canRenew() (Line: 105) Drupal\commerce_license\EventSubscriber\LicenseRenewalCartEventSubscriber->onCartEntityAdd() call_user_func() (Line: 111) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 126) Drupal\commerce_cart\CartManager->addOrderItem() (Line: 168) Drupal\commerce_add_to_cart_link\Controller\AddToCartController->action() call_user_func_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704) Drupal\Core\DrupalKernel->handle() (Line: 19)
- 🇮🇱Israel jsacksick
Hard to say if Commerce license or Commerce is to blame here actually...
Could be the Interval element...Could you check what the following returns?
$intervals = \Drupal::service('plugin.manager.interval.intervals')->getDefinitions();
This is invoked from the Interval element. See
Drupal\interval\Element\Interval::process()
- 🇸🇰Slovakia sketman
@jsacksick, how to run this code please?
Sorry once again for my ignorance, I am not a coder...