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
orkineo → created an issue.
For information, if you go to the next step of the ordering process without choosing a slot, an error message is displayed but you can return to the previous page, refresh then the times are displayed and you can select them. The console error is:
TypeError : Drupal\commerce_timeslots\Services\CommerceTimeSlots::getTimeSlotToArray(): Argument #1 ($time_frame) must be of type int, string given, called in C:\xampp\htdocs\timeslotstest\web\modules\contrib\commerce_timeslots\src\Plugin\Commerce\CheckoutPane\TimeSlotPane.php on line 166 dans Drupal\commerce_timeslots\Services\CommerceTimeSlots->getTimeSlotToArray() (C:\xampp\htdocs\timeslotstest\web\modules\contrib\commerce_timeslots\src\Services\CommerceTimeSlots.php ligne 564)
#0 C:\xampp\htdocs\timeslotstest\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\timeslotstest\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\timeslotstest\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\timeslotstest\web\core\lib\Drupal\Core\Form\FormBuilder.php(534): call_user_func_array(Array, Array)
#5 C:\xampp\htdocs\timeslotstest\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\timeslotstest\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\timeslotstest\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\timeslotstest\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#10 C:\xampp\htdocs\timeslotstest\web\core\lib\Drupal\Core\Render\Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 C:\xampp\htdocs\timeslotstest\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\timeslotstest\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#13 C:\xampp\htdocs\timeslotstest\vendor\symfony\http-kernel\HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 C:\xampp\htdocs\timeslotstest\vendor\symfony\http-kernel\HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 C:\xampp\htdocs\timeslotstest\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\timeslotstest\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\timeslotstest\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\timeslotstest\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\timeslotstest\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\timeslotstest\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\timeslotstest\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 C:\xampp\htdocs\timeslotstest\web\core\lib\Drupal\Core\DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 C:\xampp\htdocs\timeslotstest\web\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}
After testing the new release with a fresh install of Drupal Commerce, it seems we can't select a delay. The selection box is empty: There is no time slot available. Otherwise, I managed to display Times frames on a Kickstart version with the demo store but it does not display every time. If there is something I can test to advance the research, please let me know.
Hello, since this bug, the module has become unusable, I tried with several versions of the core but impossible to arrive at checkout without a blank page. It's as if the data stored in the database never made it through the ordering steps. Thanks for any progress on this issue.