Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
- Install Drupal with
datetime
module disabled or disable it manually. - Go to
admin/structure/types/manage/article/fields/add-field
, selectTimestamp
as type of field, name it and click onSave and continue
Result: There was a problem creating field Test: The "datetime_default" plugin does not exist.
.
- Got to
admin/structure/types/manage/article/fields
and see that field has been created. - Click on
Edit
.
Result: The website encountered an unexpected error. Please try again later.
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "datetime_default" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of /private/var/www/drupal/drupal8/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
Proposed resolution
The problem appears since \Drupal\Core\Field\Plugin\Field\FieldType\TimestampItem
declares the datetime_default
as value for default_widget
, but the datetime_default
is part of datetime
module and become unavailable when module will be disabled.
The same value for default_widget
exists in the following classes:
\Drupal\Core\Field\Plugin\Field\FieldType\TimestampItem
\Drupal\Core\Field\Plugin\Field\FieldType\CreatedItem
\Drupal\Core\Field\Plugin\Field\FieldType\ChangedItem
I'm seeing two resolutions here:
- Make default widget available within core (preferable).
- Forbid to disable the module (strange workaround).
Comment | File | Size | Author |
---|
Comments
Comment #2
boaloysius CreditAttribution: boaloysius as a volunteer commentedHere is the screenshot.
Comment #3
Ujwala_D CreditAttribution: Ujwala_D as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedComment #4
boaloysius CreditAttribution: boaloysius as a volunteer commentedComment #5
Ujwala_D CreditAttribution: Ujwala_D as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedComment #6
boaloysius CreditAttribution: boaloysius as a volunteer commentedComment #7
BR0kENComment #8
BR0kENComment #9
Wim LeersGreat find!
I suspect
core.entity_view_display.ENTITY_TYPE.BUNDLE.VIEW_MODE>yml
is missing a config dependency.Comment #10
mpdonadioCan you confirm what version of Drupal this is happening in? This should have been fixed in #2802663: Exceptions due ChangedItem, CreatedItem, and TimestampItem implicit dependencies on datetime module, which is in 8.3.x and 8.4.x, and I just visually verified the annotations on TimestampItem, ChangedItem, and CreatedItem that they have "datetime_timestamp" as the widget.
Comment #11
Wim LeersI knew I had recently seen something like that!
Comment #12
BR0kENI've reported this at February 19, when the problem still been existent. But now it's not, because @xjm changed this in referenced issue at March 4.