Implicit dependency on datetime

Created on 23 February 2025, about 2 months ago

Problem/Motivation

This module appears to have an implicit dependency on datetime.module:

The website encountered an unexpected error. Try again later.

Error: Class "Drupal\datetime\Plugin\Field\FieldType\DateTimeItem" not found in include() (line 22 of modules/contrib/computed_token_field/src/Plugin/Field/FieldType/ComputedTokenFieldDateTimeItem.php).

Composer\Autoload\{closure}('/var/www/html/web/modules/contrib/computed_token_field/src/Plugin/Field/FieldType/ComputedTokenFieldDateTimeItem.php') (Line: 427)
Composer\Autoload\ClassLoader->loadClass('Drupal\computed_token_field\Plugin\Field\FieldType\ComputedTokenFieldDateTimeItem')
is_subclass_of('Drupal\computed_token_field\Plugin\Field\FieldType\ComputedTokenFieldDateTimeItem', '\Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface') (Line: 225)
Drupal\Core\Field\FieldTypePluginManager->getUiDefinitions() (Line: 242)
Drupal\Core\Field\FieldTypePluginManager->getEntityTypeUiDefinitions('syncrony_circle') (Line: 186)
Drupal\field_ui\Form\FieldStorageAddForm->processFieldDefinitions(Object) (Line: 135)
Drupal\field_ui\Form\FieldStorageAddForm->buildForm(Array, Object, 'syncrony_circle', 'basic')
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('field_ui_field_storage_add_form', Object) (Line: 284)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Proposed resolution

An easy solution would be to just add the dependency to the info file. However, with Support more field types Active , this'd mean depending on many field types that might not be relevant for a given site.

Presumably there's some mechanism to make the include more selective.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦

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

Comments & Activities

Production build 0.71.5 2024