Config entities removed in wrong order causes PDOException

Created on 7 July 2016, over 8 years ago
Updated 11 September 2023, over 1 year ago

I'm using the trick at How to remove mymodule configurations on uninstall to remove 2 custom content types on module uninstallation.

One of the fields in one of them is an entity reference to the other one. Now when I try to perform the uninstallation, I get:

The Destination bundle (entity type: node) was deleted. As a result, the field_source_destination entity reference field (entity_type: node, bundle: source) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted.

exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.node__field_source_destination' doesn't exist' in /path/to/drupal/core/lib/Drupal/Core/Database/Statement.php:59

Looks like things fail in field_entity_bundle_delete().

But if the referring bundle has an entity reference field pointing to a dependent bundle, shouldn't the referring bundle be removed first? It certainly doesn't look like this is happening now.

πŸ› Bug report
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
Configuration entityΒ  β†’

Last updated 3 days ago

Created by

πŸ‡¨πŸ‡¦Canada colan Toronto πŸ‡¨πŸ‡¦

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.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @colan, Thanks for reporting this problem.

    There hasn't been any discussion here since alexpott added a reference to another issue 5 years ago.

    Is this issue still a problem?

    Thanks!

  • Status changed to Closed: outdated over 1 year ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Since no additional information has been supplied I am closing this issue.

    If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue β†’ (starting from "Install Drupal core").

    Thanks!

Production build 0.71.5 2024