This value should be of the correct primitive type for zero duration dates

Created on 16 February 2022, over 2 years ago
Updated 31 August 2023, about 1 year ago

Problem/Motivation

I have updated from 3.4.3 to 3.5.0. My site uses zero duration dates, but this is now broken.
My solution has been to downgrade again to 3.4

Steps to reproduce

Clean install of Drupal 9.3.5 and Smart_date 3.5.0. No other contrib modules.
Add smart_date with recurring dates to a content type (I used 'article'). Set the duration options and default duration to 0.
Try to create an article node and set up a single date (no recurring dates yet) and save the node.
The error message is "This value should be of the correct primitive type." with all the date elements highlighted as being in error.

The error log is:
Notice: Undefined index: end_value in Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase->massageFormValues() (line 281 of /home/peter/www/html/sandbox/public_html/modules/contrib/smart_date/src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php)

#0 /home/peter/www/html/sandbox/public_html/core/includes/bootstrap.inc(346): _drupal_error_handler_real()
#1 /home/peter/www/html/sandbox/public_html/modules/contrib/smart_date/src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php(281): _drupal_error_handler()
#2 /home/peter/www/html/sandbox/public_html/modules/contrib/smart_date/src/Plugin/Field/FieldWidget/SmartDateInlineWidget.php(66): Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase->massageFormValues()
#3 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Field/WidgetBase.php(400): Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateInlineWidget->massageFormValues()
#4 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(235): Drupal\Core\Field\WidgetBase->extractFormValues()
#5 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Entity/ContentEntityForm.php(334): Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues()
#6 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Entity/EntityForm.php(293): Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity()
#7 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Entity/ContentEntityForm.php(155): Drupal\Core\Entity\EntityForm->buildEntity()
#8 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Entity/ContentEntityForm.php(186): Drupal\Core\Entity\ContentEntityForm->buildEntity()
#9 [internal function]: Drupal\Core\Entity\ContentEntityForm->validateForm()
#10 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Form/FormValidator.php(82): call_user_func_array()
#11 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Form/FormValidator.php(275): Drupal\Core\Form\FormValidator->executeValidateHandlers()
#12 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Form/FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm()
#13 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(588): Drupal\Core\Form\FormValidator->validateForm()
#14 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm()
#15 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#16 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#17 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#18 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#19 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#20 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#21 /home/peter/www/html/sandbox/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#22 /home/peter/www/html/sandbox/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#23 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#24 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#25 /home/peter/www/html/sandbox/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#26 /home/peter/www/html/sandbox/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#27 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#28 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#29 /home/peter/www/html/sandbox/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#30 /home/peter/www/html/sandbox/public_html/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle()
#31 /home/peter/www/html/sandbox/public_html/index.php(19): Drupal\Core\DrupalKernel->handle()
#32 {main}

Proposed resolution

At the moment, my solution is to downgrade again to 3.4.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Postponed: needs info

Version

3.5

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom jprj

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024