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
Comment | File | Size | Author |
---|---|---|---|
#4 | 2762273.3.patch | 7.85 KB | alexpott |
#2 | 2762273.2.patch | 4.58 KB | alexpott |
Comments
Comment #2
alexpottHere's a patch
Comment #3
alexpottHere'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.Comment #4
alexpottComment #8
penyaskitoRe-testing now that was committed.
Comment #9
penyaskitoTests passed, thanks!
Comment #11
penyaskitoCommitted 4b50c63 and pushed to 8.x-1.x. Thanks Alex!
Comment #12
penyaskito