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