Hi everyone

When i try to search for content under sources and set the filter to any of the target languages the site crashes:
error

and the erro is:
The website encountered an unexpected error. Please try again later.

In the logs i see the following:
Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'title' in where clause is ambiguous: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node} e INNER JOIN {node_field_data} data_table ON data_table.nid = e.nid AND data_table.default_langcode = 1 LEFT OUTER JOIN {node_field_data} translation_de ON translation_de.nid= e.nid AND translation_de.langcode = :language WHERE (data_table.langcode <> :db_condition_placeholder_0) AND ((translation_de.langcode IS NULL) OR (translation_de.content_translation_outdated = :db_condition_placeholder_1)) AND (title LIKE :db_condition_placeholder_2 ESCAPE '\\') AND (e.type IN (:db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5)) AND (data_table.langcode IN (:db_condition_placeholder_6, :db_condition_placeholder_7))) subquery; Array ( [:db_condition_placeholder_0] => de [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => %About% [:db_condition_placeholder_3] => article [:db_condition_placeholder_4] => page [:db_condition_placeholder_5] => recipe [:db_condition_placeholder_6] => en [:db_condition_placeholder_7] => de [:language] => de ) in Drupal\Core\Database\Connection->handleQueryException() (line 683 of C:\xampp\htdocs\drupal8615\core\lib\Drupal\Core\Database\Connection.php).

Comments

arben128 created an issue. See original summary.

deaom’s picture

Status: Active » Needs review
StatusFileSize
new741 bytes

Hi, had the same issue as described. It happens because query does not know which title to look at. So I added table alias 'data_table' before the $label_key. For me it's now working.

jrochate’s picture

Thanks! That solved the error I was having on 1.x-dev.

Commit?

jrochate’s picture

Status: Needs review » Reviewed & tested by the community
berdir’s picture

Issue tags: -source search target language
StatusFileSize
new1.52 KB
new2.25 KB

Thanks for the fix, added a test.

berdir’s picture

Title: erro when searching for content with target langauge » Error when searching for content with target langauge

The last submitted patch, 5: integrity_constraint_error-3071668-5-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

  • Berdir committed eefdff1 on 8.x-1.x authored by DeaOm
    Issue #3071668 by Berdir, DeaOm, arben128: Error when searching for...

Status: Fixed » Closed (fixed)

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