Problem/Motivation
Cannot delete field of type "date recur".
Steps to reproduce
1. Add field of type "date recur" using machine name "field_date_recur".
2. Try to delete this field. The following error appears:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_10002_dev.date_recur__node__field_date_recur' doesn't exist: DELETE FROM {date_recur__node__field_date_recur} WHERE "entity_id" = :db_condition_placeholder_0; Array ( [:db_condition_placeholder_0] => 140 ) in Drupal\date_recur\DateRecurOccurrences->onEntityDelete() (Zeile 185 in /var/www/vhosts/sbm.einskommanull.com/dev.sbm.einskommanull.com/web/modules/contrib/date_recur/src/DateRecurOccurrences.php).
Proposed resolution
Field gets deleted without error.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork date_recur-3217384
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
e5sego commentedAs a workaround, you can first dump the table date_recur__node__field_date_recur (or similar name on you install) and recreate it if the above error accours. Than reload the page with the error message and the field is dropped.
Comment #3
khaldoon_masud commented+1 having the same issue
Comment #5
dpiI'm not clear how this is possible, especially considering the test exists for this:
\Drupal\Tests\date_recur\Kernel\DateRecurOccurrenceTableAttachedTest::testTableCreateDeleteOnFieldStorageCreateSo my only conclusion to this is the table isnt getting created due to permissions, or is being deleted manually, for some reason.
So I'm adding a table exists guard, and hoping this resolves the trouble.
Comment #9
dpiCommitted to 3.1.x and 3.2.x.