Error: Call to a member function get() on bool

Created on 23 November 2021, about 3 years ago
Updated 5 January 2024, 12 months ago

Problem/Motivation

When saving a new event with a recurring date:

Error: Call to a member function get() on bool in Drupal\smart_date_recur\Entity\SmartDateRule->getTimeZone() (line 945 of /app/web/modules/custom/smart_date/modules/smart_date_recur/src/Entity/SmartDateRule.php)
#0 /app/web/modules/custom/smart_date/modules/smart_date_recur/src/Entity/SmartDateRule.php(298): Drupal\smart_date_recur\Entity\SmartDateRule->getTimeZone()
#1 /app/web/modules/custom/smart_date/modules/smart_date_recur/src/Entity/SmartDateRule.php(234): Drupal\smart_date_recur\Entity\SmartDateRule->getAssembledRule()
#2 /app/web/modules/custom/smart_date/modules/smart_date_recur/src/Entity/SmartDateRule.php(165): Drupal\smart_date_recur\Entity\SmartDateRule->makeRuleInstances(NULL, NULL)
#3 /app/web/modules/custom/smart_date/modules/smart_date_recur/smart_date_recur.module(705): Drupal\smart_date_recur\Entity\SmartDateRule->getRuleInstances(NULL)
#4 /app/web/modules/custom/smart_date/src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php(342): smart_date_recur_generate_rows(Array, 'node', 'workshop', 'field_when', 12)
#5 /app/web/modules/custom/smart_date/src/Plugin/Field/FieldWidget/SmartDateInlineWidget.php(66): Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase->massageFormValues(Array, Array, Object(Drupal\Core\Form\FormState))
#6 /app/web/core/lib/Drupal/Core/Field/WidgetBase.php(400): Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateInlineWidget->massageFormValues(Array, Array, Object(Drupal\Core\Form\FormState))
#7 /app/web/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(235): Drupal\Core\Field\WidgetBase->extractFormValues(Object(Drupal\smart_date\Plugin\Field\FieldType\SmartDateFieldItemList), Array, Object(Drupal\Core\Form\FormState))
#8 /app/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(334): Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues(Object(Drupal\node\Entity\Node), Array, Object(Drupal\Core\Form\FormState))
#9 /app/web/core/lib/Drupal/Core/Entity/EntityForm.php(293): Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity(Object(Drupal\node\Entity\Node), Array, Object(Drupal\Core\Form\FormState))
#10 /app/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(155): Drupal\Core\Entity\EntityForm->buildEntity(Array, Object(Drupal\Core\Form\FormState))
#11 /app/web/core/lib/Drupal/Core/Entity/EntityForm.php(278): Drupal\Core\Entity\ContentEntityForm->buildEntity(Array, Object(Drupal\Core\Form\FormState))
#12 /app/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(145): Drupal\Core\Entity\EntityForm->submitForm(Array, Object(Drupal\Core\Form\FormState))
#13 [internal function]: Drupal\Core\Entity\ContentEntityForm->submitForm(Array, Object(Drupal\Core\Form\FormState))
#14 /app/web/core/lib/Drupal/Core/Form/FormSubmitter.php(113): call_user_func_array(Array, Array)
#15 /app/web/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#16 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(593): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#17 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm('node_workshop_f...', Array, Object(Drupal\Core\Form\FormState))
#18 /app/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\node\NodeForm), Object(Drupal\Core\Form\FormState))
#19 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#20 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#21 /app/web/core/lib/Drupal/Core/Render/Renderer.php(578): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#22 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#23 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#24 /app/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#25 /app/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#26 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /app/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /app/web/core/lib/Drupal/Core/DrupalKernel.php(717): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#35 {main}
.

Proposed resolution

Check for a valid rule before attempting to get the timezone.

🐛 Bug report
Status

Fixed

Version

3.5

Component

Smart Date Recur

Created by

🇨🇦Canada mandclu

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.

  • First commit to issue fork.
Production build 0.71.5 2024