- Status changed to Needs work
almost 2 years ago 7:36am 19 January 2023 - Status changed to Needs review
almost 2 years ago 8:31am 19 January 2023 - Status changed to Fixed
almost 2 years ago 9:03pm 19 January 2023 - 🇨🇭Switzerland janes_p Zurich
Showing lists and individual rows/endities is working fine now (same provider table as above):
Read -
SELECT provider_id AS "id", * FROM {1:provider} WHERE provider_id = :id
List -SELECT provider_id, provider_name FROM {1:provider} WHERE TRUE :filters
Count -SELECT COUNT(*) FROM {1:provider}
Mappings:
ID
-provider_id
Title
-provider_name
Description
-provider_description
Provider Identifier
-provider_identifier
I am now trying to use the external entity in a view (to use formatting options). As per «known limitations» of the External Entities module, the Search API module with an index is required. Creating the index raises an error message:
Query failed: SQLSTATE[42703]: Undefined column: 7 ERROR: column "id" does not exist LINE 1: ...ame FROM "plan_e"."provider" WHERE TRUE ORDER BY id ASC LIM... ^: SELECT provider_id, provider_name FROM "plan_e"."provider" WHERE TRUE ORDER BY id ASC LIMIT 100; Array ( )
Looks like a mixup of placeholders and real column names.
- 🇫🇷France guignonv
I have changed the SQL statements to fully qualified statements as per your documentation, to be on the safe side (and I cleared caches thereafter):
Read - SELECT p.provider_id, p.provider_name, p.provider_description, p.provider_identifier FROM {1:provider} p WHERE p.provider_id = :id
List - SELECT p.provider_id, p.provider_name FROM {1:provider} p WHERE TRUE :filters
Count - SELECT COUNT(1) FROM {1:provider} pStill the same error message:
Query failed: SQLSTATE[42703]: Undefined column: 7 ERROR: column "id" does not exist LINE 1: ...e FROM "plan_e"."provider" p WHERE TRUE ORDER BY id ASC LIM... ^: SELECT p.provider_id, p.provider_name FROM "plan_e"."provider" p WHERE TRUE ORDER BY id ASC LIMIT 100; Array ( )
Looks like the placeholder id is used in the :filters instead of the column name provider_id, or maybe the colon is missing in front of id.
That's a different issue. Let's see that in #3335729 🐛 Drupal filters are not using the mapped fields in SQL query Fixed .
Automatically closed - issue fixed for 2 weeks with no activity.