Problem/Motivation

During configuration import we're seeing errors like:

exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table [error]
'd8ixiacom.block_content__lingotek_translation_status' doesn't exist' in
/mnt/www/html/d8ixiacom/docroot/core/lib/Drupal/Core/Database/Statement.php:59

This is caused by loading content entities in ConfigImporter::processMissingContent() and having changes to lingotek.settings like:

   entity:
     block_content:
       basic:
-        enabled: false
+        enabled: true
+        field:
+          info: true
+          body: true
+        profile: ixia_prod

The module provides \Drupal\lingotek\EventSubscriber\LingotekConfigSubscriber which listens to both the ConfigEvents::SAVE and ConfigEvents::IMPORT but actually everything that happens on import should actually occur on save. The ConfigEvents::IMPORT runs after the import has finished and this is too late.

Proposed resolution

Remove the ConfigEvents::IMPORT and do this on ConfigEvents::SAVE. The entity updates are probably called from the UI so we'll be able to remove that too.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Here's a patch

alexpott’s picture

Here's a patch with a test - unfortunately it's revealed a small bug in the one of the test config entities because we've never had config_test and config_translation enabled at the same time :) - see #2762347: config_test_no_status has wrong edit route

So the \Drupal\lingotek\Tests\LingotekConfigImportTest will fail until that's fixed.

alexpott’s picture

Status: Needs review » Needs work

The last submitted patch, 4: 2762273.3.patch, failed testing.

The last submitted patch, 4: 2762273.3.patch, failed testing.

The last submitted patch, 4: 2762273.3.patch, failed testing.

penyaskito’s picture

Status: Needs work » Needs review

Re-testing now that was committed.

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Tests passed, thanks!

penyaskito’s picture

Committed 4b50c63 and pushed to 8.x-1.x. Thanks Alex!

penyaskito’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.