Account created on 15 April 2010, over 14 years ago
#

Recent comments

🇦🇹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)

🇦🇹Austria ViNCE

I'm facing the same problem.

[notice] Update started: group_update_9203
[error]  Call to a member function getPluginId() on null
[error]  Update failed: group_update_9203

Already spent half a day and a night to try different ways. Already having several thousand entries in the database. Couldn't find a way to filter out faulty ones.
Any ideas how to either:

  • filter out and remove faulty entries?
  • or change the update code in a way not ending up in a fatal error?

the actual code in group.install is:

function group_update_9203(&$sandbox) {
  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
  $last_installed_schema_repository = \Drupal::service('entity.last_installed_schema.repository');
  assert($last_installed_schema_repository instanceof EntityLastInstalledSchemaRepositoryInterface);

  // Update the database tables.
  $entity_type = $definition_update_manager->getEntityType('group_content');
  $entity_type->set('base_table', 'group_relationship');
  $entity_type->set('data_table', 'group_relationship_field_data');

  // Add the plugin_id and group_type field.
  $field_storage_definitions = $last_installed_schema_repository->getLastInstalledFieldStorageDefinitions('group_content');
  $field_storage_definitions['plugin_id'] = BaseFieldDefinition::create('string')
    ->setName('plugin_id')
    ->setTargetEntityTypeId('group_content')
    ->setTargetBundle(NULL)
    ->setLabel(t('Plugin ID'))
    ->setRequired(TRUE)
    ->setReadOnly(TRUE)
    ->setInitialValue('TEMP')
    ->setProvider('group');

  $field_storage_definitions['group_type'] = BaseFieldDefinition::create('entity_reference')
    ->setName('group_type')
    ->setTargetEntityTypeId('group_content')
    ->setTargetBundle(NULL)
    ->setLabel(t('Group type'))
    ->setSetting('target_type', 'group_type')
    ->setRequired(TRUE)
    ->setReadOnly(TRUE)
    ->setInitialValue('TEMP')
    ->setProvider('group');

  // Update the fields and regenerate indexes, the correct initial values will
  // be retrieved from GroupRelationshipStorage::restore().
  $definition_update_manager->updateFieldableEntityType($entity_type, $field_storage_definitions, $sandbox);
}
Production build 0.71.5 2024