Using Smart Importer with tables that have a prefix

Created on 20 July 2019, almost 5 years ago
Updated 2 July 2023, about 1 year ago

When using Smart Importer when the tables in the database having a prefix (hosting service required it), it can not find the commerce_store_field_data table.

Clicking either on Configure or "I have CVS File for import" creates the following page error: The website encountered an unexpected error. Please try again later.

The log error indicates the following:
1603 20/Jul 18:53 php Error Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table
'db787516814.commerce_store_field_data' doesn't exist: SELECT store_id, name FROM c

Created the same table without the prefix, works like a charm. How will it effect the import if the one table doesn't have a prefix but the others do.

🐛 Bug report
Status

Needs review

Component

Code

Created by

🇺🇸United States TBone242

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 allisonc New York

    /src/Form/SmartImporterConfigurationForm.php:92
    Code should be changed to:

    $sql = $this->database->select('commerce_store_field_data', 'cs')->fields('cs', ['store_id', 'name'])->execute()->fetchAll();
    
Production build 0.69.0 2024