Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jan 2012 at 12:08 UTC
Updated:
6 Mar 2013 at 14:53 UTC
Just uninstalled Media 7.x-1.0-rc2 and installed 7.x-2.x-dev
In general it all works, and the images that were there before are still there.
When I go "Select media", the following error appears in the top part of the Upload/Web/Library box
The same error appears when I try to edit the Media Browser View.
'Exception: SQLSTATE[42702]: Ambiguous column: 7 ERROR: column reference "fid" is ambiguous
LINE 8: GROUP BY file_managed_timestamp, fid) subquery
^'in views_plugin_query_default->execute() (line 1386 of D:\inetpub\wwwroot\drupal\sites\all\modules\views\plugins\views_plugin_query_default.inc).
Comments
Comment #1
dave reidI might have to move this to the Views issue queue to see if they have any answer. We have a default view in the Media module that is on the {file_managed} table, and aggregates the file usage field as a total.
Comment #2
acbramley commented+1 got this when upgrading from media 1.x to 2.x, the query on the media browser view provided by the media module looks like this:
Comment #3
wiifmHaving the same issue. Currently running on postgreSQL 9.1.5 (latest)
Current SQL executed by the view (that ships with default media 2.x):
PostgreSQL error (when run manually against the DB):
I made a small change to the manual SQL (
file_managed.fid AS file_managed_fid), and the query runs:I of course have no idea how to alter the view in order to produce said SQL.
Any views ninjas around to help debug?
Comment #4
acbramley commentedA workaround for now is to remove the aggregation settings from the view.
Comment #5
steinmb commentedI'm seeing the same thing using Postgres 9.21. The code in #3 works also fine for me.
Comment #6
steverweber commentedbump.. same error, running dev branch media on PostgreSQL with latest dev code on most modules.
Comment #7
steverweber commentedComment #8
t_en commentedHaving the same problem with (using Postgres 9.17 on Linux). The select in #3 works in my installation.
Is this the same issue? #1331056: Regression: Improper use of GROUP BY statement produces ambiguous column error
The last patch supplied in that issue seems to resolve this too (subject to more testing, but the error message goes away).
Comment #9
jneubert commentedThanks, Torsten, the patch you mentioned fixed it for me too.
Comment #10
steverweber commentedSince #1331056: Regression: Improper use of GROUP BY statement produces ambiguous column error
fixes the underlying issue.