- Issue created by @pablo.fredes
- 🇦🇷Argentina pablo.fredes Rosario
pablo.fredes → changed the visibility of the branch 3440576-typeerror-explode-argument to hidden.
- Merge request !105Draft: Resolve #3440576 "Typeerror explode argument" → (Closed) created by pablo.fredes
- Merge request !106TypeError en SmartDateListItemBase::parseValues → (Merged) created by pablo.fredes
- Status changed to Postponed: needs info
8 months ago 11:03am 20 April 2024 - 🇨🇦Canada mandclu
Here's what I tried:
On a site running Drupal 10.2, I created a new content type and added a Smart Date field. No error.
I created a new node of the new type. No error.
I'm going to need more detailed steps to reproduce your issue on a fresh install of Drupal.
- 🇦🇹Austria ViNCE
https://www.drupal.org/files/issues/2024-04-12/smart_date_type_string.patch → --> worked for me.
Before error message was:
The website encountered an unexpected error. Try again later.TypeError: explode(): Argument #2 ($string) must be of type string, array given in explode() (line 30 of modules/contrib/smart_date/src/Plugin/Field/FieldType/SmartDateListItemBase.php).
Drupal\smart_date\Plugin\Field\FieldType\SmartDateListItemBase::Drupal\smart_date\Plugin\Field\FieldType\{closure}() (Line: 40)
Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall() (Line: 36)
Drupal\smart_date\Plugin\Field\FieldType\SmartDateListItemBase::parseValues() (Line: 247)
Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase::createWidget() (Line: 185)
Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase->formElement() (Line: 110)
Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateDefaultWidget->formElement() (Line: 35)
Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateInlineWidget->formElement() (Line: 40)
Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateTimezoneWidget->formElement() (Line: 459)
Drupal\Core\Field\WidgetBase->formSingleElement() (Line: 550)
Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase->formMultipleElements() (Line: 120)
Drupal\Core\Field\WidgetBase->form() (Line: 186)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm() (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form() (Line: 127)
Drupal\node\NodeForm->form() (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 270)
Drupal\shield\ShieldMiddleware->bypass() (Line: 178)
Drupal\shield\ShieldMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19) - Status changed to Fixed
8 months ago 9:02pm 29 April 2024 - 🇨🇦Canada mandclu
I still have never been able to reproduce the error, but I updated to code to only run the explode if the $values aren't already an array, which seems like a sensible check anyway.
-
mandclu →
committed 8ddbc2ff on 4.1.x authored by
pablo.fredes →
Issue #3440576 by pablo.fredes, mandclu: TypeError: explode(): Argument...
-
mandclu →
committed 8ddbc2ff on 4.1.x authored by
pablo.fredes →
Automatically closed - issue fixed for 2 weeks with no activity.