Ambiguous column: 7 ERROR: column reference "type" is ambiguous in OnlyOne.php

Created on 7 October 2022, about 2 years ago
Updated 30 March 2024, 8 months ago

Problem/Motivation

On the module installation, when I try to get to the configuration page (admin/config/content/onlyone) I get this error:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42702]: Ambiguous column: 7 ERROR: column reference "type" is ambiguous LINE 11: GROUP BY type, ^: SELECT DISTINCT node_type.type, node_field_data.langcode AS language, COUNT(node.nid) AS total FROM db_temporary_0 node_type LEFT JOIN "node" node USING(type) LEFT JOIN "node_field_data" node_field_data USING(nid) WHERE node_type.type NOT IN (SELECT node.type FROM "node" node JOIN "node_field_data" node_field_data USING(nid) GROUP BY type, node_field_data.langcode HAVING COUNT(nid) > 1) GROUP BY type, node_field_data.langcode ORDER BY node_type.type ASC; Array ( ) in Drupal\onlyone\OnlyOne->getAvailableContentTypesSummarized() (line 295 of modules/contrib/onlyone/src/OnlyOne.php).

I am working on a fix right now, the SQL query is not specific enough.

🐛 Bug report
Status

Needs review

Version

1.10

Component

Code

Created by

🇫🇷France Quentin Harelle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024