When i try to open the content/files tab i got the following error:
PDOException: SQLSTATE[42803]: Grouping error: 7 ERROR: column "fu.fid" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT fu.fid AS fid, fu.count AS count, SUM(fu.count) AS to... ^: SELECT fu.fid AS fid, fu.count AS count, SUM(fu.count) AS total_count FROM {file_usage} fu WHERE (fu.fid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1 ) en file_entity_admin_files() (línea 366 de /var/www/drupal7/sites/all/modules/file_entity/file_entity.admin.inc).
Please help me to resolv this problem.
Thanks.
Comments
Comment #2
marcopgordillo CreditAttribution: marcopgordillo commentedIn file /var/www/drupal7/sites/all/modules/file_entity/file_entity.admin.inc line 365
I edit:
//$count_query->addExpression('SUM(fu.count)', 'total_count');
$count_query->addExpression('fu.count', 'total_count');
And it is solved
Comment #3
marcopgordillo CreditAttribution: marcopgordillo as a volunteer commentedComment #4
joseph.olstadThanks for the heads up on the postgresql compatibility.
look at rolling a patch for this and testing it vs mysql.
Comment #5
joseph.olstadneeds patch asap.
Comment #6
oadaeh CreditAttribution: oadaeh at Hook 42 commentedThere is no patch. The status is active.
Comment #7
slippast CreditAttribution: slippast commentedWeird that this problem has been floating around for a year, but I just hit it. Anyway, the quick change from #1 fixed it.
Comment #8
joseph.olstadwhat database driver are you using? is this postgres?
Comment #9
joseph.olstad@slippast, I repeat what database driver are you using? is this postgres?
this is an important piece of information required to assess this issue.
Comment #10
slippast CreditAttribution: slippast commentedJoseph, I'm sorry I didn't get back to you! I just updated the File Entity module and found myself back here to perform fix #1.
I'm using: PostgreSQL 9.6.10, PHP 5.5.9. We do employ a DB load balancer for Postgres, I can find out details on that software if that is helpful. My Drupal install is on the current version (as of Jan 3, 2019).
Note: I have not updated the the most current version of the Media module yet, though I will next week. I'm on Media 2.20.
Edit: I had notifications turned off.... They're on now so I'll hopefully know if you post further questions. Sorry about that.
Comment #11
joseph.olstadok , so you confirm that fix #1 works for you.
here is a patch, lets run it against the testbots.
Comment #12
joseph.olstadComment #13
joseph.olstadshould be good, given the severity, functional vs query accuracy, go with functional first. Query results likely the same , haven't checked yet though. would be good to check mysql before/after. We this fixes postgresql , so no need to test that.
Comment #14
joseph.olstadComment #17
joseph.olstadComment #18
joseph.olstadya SUM of count redundant.
what is the SUM of 10 ? if count(fu.count) is 10?
so ya, patched, thanks for the patch!