Hi,

I´m trying to use the module, but once I click on "MySQL Views" I get an empty list of Webforms. I we are having this error on the log entries:

Column 'nid'; in field list is ambiguous query: SELECT DISTINCT nid, title FROM node n LEFT JOIN domain_access da ON n.nid = da.nid WHERE ((da.realm = "domain_id" AND da.gid = 0)) AND ( type IN ("event","meeting","paidevent","webform") AND status = 1 )ORDER BY nid in /var/www/sites/all/modules/webform_mysql_views/webform_mysql_views.module on line 192.

Obviously is a Query error, but I´m not sure how to solve it. We have four different content types serving also as webforms.

Thanks in advance.

Comments

pomliane’s picture

@clemenbor: Same issue here. Domain Access related issue?

cafuego’s picture

I domain access rewrites that select query because it's run through db_rewrite_sql() to patch in its own access checks. It joins its own table, which also has a nid column. Because the original query doesn't explicitly specify the table to select from and order by, MySQL gets confused after that second table is added.

The fix is to apply the patch from #1038532: Do not see exisitng webforms under /admin/content/webform/mysql (Webform 3.x) and then replace line 193:

$query = db_rewrite_sql('SELECT nid, title, type FROM {node} AS n WHERE type IN (' . $placeholders . ') ORDER BY nid ASC');

with:

$query = db_rewrite_sql('SELECT n.nid, n.title, n.type FROM {node} AS n WHERE n.type IN ('. $placeholders .') ORDER BY n.nid ASC');

cafuego’s picture

Version: 6.x-1.2 » 6.x-2.x-dev
Assigned: Unassigned » cafuego
Status: Active » Needs review

Fix for this has been applied to 6.x-1.x and 6.x-2.x, please test.