Error when attempting to remove a date_recur field

Created on 9 September 2020, over 4 years ago
Updated 29 January 2025, 2 months ago

When attempting to remove a date_recur field I am being met with a WSOD error.

Any suggestions how to manage this? Version 2.2

The website encountered an unexpected error. Please try again later.

Drupal\Core\Entity\EntityStorageException: Exception thrown while performing a schema update. Cannot rename 'node__field_date_time' to 'field_deleted_data_26aade79fc': table 'field_deleted_data_26aade79fc' already exists. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1615 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->onFieldStorageDefinitionDelete(Object) (Line: 1593)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->Drupal\Core\Entity\Sql\{closure}() (Line: 1611)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException(Object) (Line: 1596)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->onFieldStorageDefinitionDelete(Object) (Line: 133)
Drupal\Core\Field\FieldStorageDefinitionListener->onFieldStorageDefinitionDelete(Object) (Line: 438)
Drupal\field\Entity\FieldStorageConfig::postDelete(Object, Array) (Line: 432)
Drupal\Core\Entity\EntityStorageBase->delete(Array) (Line: 250)
Drupal\field\Entity\FieldConfig::postDelete(Object, Array) (Line: 432)
Drupal\Core\Entity\EntityStorageBase->delete(Array) (Line: 403)
Drupal\Core\Entity\EntityBase->delete() (Line: 100)
Drupal\field_ui\Form\FieldConfigDeleteForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('field_config_delete_form', Array, Object) (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
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: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

πŸ› Bug report
Status

Active

Version

3.8

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom mrpauldriver

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States choicelildice

    I don't think this is a Drupal core issue, as I have several sites running date_recur, and cannot remove the field on any of them without an error. Other fields are ok to remove, unless you have tried to remove the date_recur field first, and then removing any other field gives the same error. The error I'm seeing is:

    Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.date_recur__node__field_test' doesn't exist: DELETE FROM "date_recur__node__field_test" WHERE "entity_id" = :db_condition_placeholder_0; Array ( [:db_condition_placeholder_0] => 1 ) in Drupal\date_recur\DateRecurOccurrences->onEntityDelete() (line 158 of modules/contrib/date_recur/src/DateRecurOccurrences.php).

    I created a clean Drupal 10.4.1 install locally, and installed 3.8.1 and am getting the error.

    Steps to reproduce:

    1. Install a clean Drupal 10.4.1
    2. Install date_recur version 3.8.1
    3. Add a date recur field to the "Basic Page" content type
    4. Add a test basic page and make sure the date field is set and has a start and end date for occurrences, as well as a time zone
    5. Save the page
    6. Try to remove the recurring date field from the content type
  • πŸ‡ΊπŸ‡ΈUnited States choicelildice

    I apologize, my previous comment should have been added to https://www.drupal.org/project/date_recur/issues/3328422 πŸ› DateRecurOccurrences::onEntityTypeDelete makes it impossible to delete an entity type and its code at the same time Needs work instead of this issue. Closing.

Production build 0.71.5 2024