Getting a 'user warning' like:

user warning: Column 'name' in order clause is ambiguous query: SELECT COUNT(DISTINCT(t.tid)) FROM term_data t INNER JOIN term_hierarchy h ON h.tid = t.tid LEFT JOIN forum_access fa ON t.tid = fa.tid LEFT JOIN acl acl_fa ON acl_fa.name = t.tid AND acl_fa.module = 'forum_access' LEFT JOIN acl_user aclu_fa ON aclu_fa.acl_id = acl_fa.acl_id AND aclu_fa.uid = 3 WHERE ((fa.grant_view >= 1 AND fa.rid IN (2, 3)) OR fa.tid IS NULL OR aclu_fa.uid = 3) AND ( t.vid = 2 AND h.parent = 17 )ORDER BY weight, name in /var/www/XXXX/sites/all/modules/fileframework/contrib/gallery/file_gallery.module on line 234.

in some cases of viewing file galery. Probably it occured after installing acl and/or forum_access modules so it may occure using other modules too.

Comments

Daugilas’s picture

Above line 234 in /fileframework/contrib/gallery/file_gallery.module there are 4 queries formed. You need to add table name to column name in sorting results
there are: <...> ORDER BY weight, name';
it has to be <...> ORDER BY t.weight, t.name';

do these changes in lines 227, 228, 231 and 232

after this warning appears to be gone

miglius’s picture

Assigned: Unassigned » miglius
Status: Active » Fixed
Issue tags: -MySQL, -user warning +sql

Committed, dekui ;)

Status: Fixed » Closed (fixed)
Issue tags: -file_gallery, -sql

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