There are no available time frames for this date. Please, choose a different date.

Created on 15 March 2023, over 1 year ago
Updated 7 September 2023, 10 months ago

Problem/Motivation

For each new cart, whatever the configuration of the module, when I access the order checkout, the date selection appears but always with an empty time frames drop-down list.

If I try to continue to the order summary without choosing anything from the dropdown I end up with the php type error described below. On the other hand, if I return to the previous page and I refresh my caches, the drop-down menu now displays the times frames with the available places and I can place the order.

Steps to reproduce

I am using Drupal 9.5.4 / PHP Version 8.1.12
Fresh install of commerce kickstart with composer and last version of Commerce Time Slots module

Php type error in the console

TypeError : Drupal\commerce_timeslots\Services\CommerceTimeSlots::getTimeSlotToArray(): Argument #1 ($time_frame) must be of type int, string given, called in C:\xampp\htdocs\kickstarttimeslots\web\modules\contrib\commerce_timeslots\src\Plugin\Commerce\CheckoutPane\TimeSlotPane.php on line 166 dans Drupal\commerce_timeslots\Services\CommerceTimeSlots->getTimeSlotToArray() (C:\xampp\htdocs\kickstarttimeslots\web\modules\contrib\commerce_timeslots\src\Services\CommerceTimeSlots.php ligne 564)

#0 C:\xampp\htdocs\kickstarttimeslots\web\modules\contrib\commerce_timeslots\src\Plugin\Commerce\CheckoutPane\TimeSlotPane.php(166): Drupal\commerce_timeslots\Services\CommerceTimeSlots->getTimeSlotToArray('', Object(Drupal\Core\Datetime\DrupalDateTime))
#1 C:\xampp\htdocs\kickstarttimeslots\web\modules\contrib\commerce\modules\checkout\src\Plugin\Commerce\CheckoutPane\Review.php(28): Drupal\commerce_timeslots\Plugin\Commerce\CheckoutPane\TimeSlotPane->buildPaneSummary()
#2 C:\xampp\htdocs\kickstarttimeslots\web\modules\contrib\commerce\modules\checkout\src\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase.php(546): Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\Review->buildPaneForm(Array, Object(Drupal\Core\Form\FormState), Array)
#3 [internal function]: Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase->buildForm(Array, Object(Drupal\Core\Form\FormState), 'review')
#4 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\Form\FormBuilder.php(534): call_user_func_array(Array, Array)
#5 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\Form\FormBuilder.php(281): Drupal\Core\Form\FormBuilder->retrieveForm('commerce_checko...', Object(Drupal\Core\Form\FormState))
#6 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\Form\FormBuilder.php(222): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\MultistepDefault), Object(Drupal\Core\Form\FormState))
#7 C:\xampp\htdocs\kickstarttimeslots\web\modules\contrib\commerce\modules\checkout\src\Controller\CheckoutController.php(143): Drupal\Core\Form\FormBuilder->getForm(Object(Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\MultistepDefault), 'review')
#8 [internal function]: Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object(Drupal\Core\Routing\RouteMatch))
#9 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#10 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\Render\Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#13 C:\xampp\htdocs\kickstarttimeslots\vendor\symfony\http-kernel\HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 C:\xampp\htdocs\kickstarttimeslots\vendor\symfony\http-kernel\HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\StackMiddleware\Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 C:\xampp\htdocs\kickstarttimeslots\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 C:\xampp\htdocs\kickstarttimeslots\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 C:\xampp\htdocs\kickstarttimeslots\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 C:\xampp\htdocs\kickstarttimeslots\web\core\lib\Drupal\Core\DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 C:\xampp\htdocs\kickstarttimeslots\web\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France orkineo

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

Comments & Activities

  • Issue created by @orkineo
  • πŸ‡²πŸ‡©Moldova andrei.vesterli Chisinau

    Hi @orkineo

    Can you please provide me with more details regarding your issue? I need some screenshots of your product variation configuration. A screen cast will help too.

    Regards,
    Andrei

  • Status changed to Postponed: needs info 10 months ago
  • πŸ‡²πŸ‡©Moldova andrei.vesterli Chisinau
  • πŸ‡«πŸ‡·France orkineo

    Hi Andrei,
    Thank you very much for your work, I installed a fresh drupal 9.5.10 with commerce core 8.x-2.36 and commerce_timeslots 1.1.0 and everything seems to work correctly, I no longer have the corresponding error.

    The new version 1.1.0 from September 4, 2023 seems to resolve the problem. In our case we went to a solution with the boockable calendars module but we will think about the switch to your solution. If so I will give more details on the final configuration.

    Regards,
    Vincent

  • πŸ‡²πŸ‡©Moldova andrei.vesterli Chisinau

    Hi @orkineo

    Wow, that's nice to hear. Sure, I can help you with the configuration. Did you check the module documentation first?

    We can have a connection and I can help you with the module setup.

    Regards,
    Andrei

  • Status changed to Closed: outdated 10 months ago
  • πŸ‡²πŸ‡©Moldova andrei.vesterli Chisinau
Production build 0.69.0 2024