Recently I started face into exception on node save:

The website encountered an unexpected error. Please try again later.
Error: Call to a member function isEmpty() on null in Drupal\office_hours\Plugin\Field\FieldWidget\OfficeHoursWeekWidget->massageFormValues() (line 176 of modules/contrib/office_hours/src/Plugin/Field/FieldWidget/OfficeHoursWeekWidget.php).
Drupal\office_hours\Plugin\Field\FieldWidget\OfficeHoursWeekWidget->massageFormValues() (Line: 400)
Drupal\Core\Field\WidgetBase->extractFormValues() (Line: 237)
Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues() (Line: 334)
Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity() (Line: 293)
Drupal\Core\Entity\EntityForm->buildEntity() (Line: 155)
Drupal\Core\Entity\ContentEntityForm->buildEntity() (Line: 186)
Drupal\Core\Entity\ContentEntityForm->validateForm()
call_user_func_array() (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers() (Line: 275)
Drupal\Core\Form\FormValidator->doValidateForm() (Line: 118)
Drupal\Core\Form\FormValidator->validateForm() (Line: 591)
Drupal\Core\Form\FormBuilder->processForm() (Line: 323)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 718)
Drupal\Core\DrupalKernel->handle() (Line: 19)

BTW didn't set seasons at all.

My content type has paragraph field.
And this error only occurs when I add or delete paragraph item.
When I edit exists paragraph values - no error.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

super_romeo created an issue. See original summary.

super_romeo’s picture

Issue summary: View changes

super_romeo’s picture

It is just a workaround.

johnv’s picture

Title: Error: Call to a member function isEmpty() on null in OfficeHoursWeekWidget->massageFormValues() » Error: season = null in OfficeHoursWeekWidget->massageFormValues()

  • johnv committed 2c9f4182 on 8.x-1.x
    Issue #3342673: Error: season = null in OfficeHoursWeekWidget->...
johnv’s picture

Status: Active » Fixed

Using a proper getter function should do the trick.
Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.