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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcopgordillo created an issue. See original summary.

marcopgordillo’s picture

In 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

marcopgordillo’s picture

Status: Active » Fixed
joseph.olstad’s picture

Status: Fixed » Needs review

Thanks for the heads up on the postgresql compatibility.
look at rolling a patch for this and testing it vs mysql.

joseph.olstad’s picture

Status: Needs review » Needs work

needs patch asap.

oadaeh’s picture

Status: Needs work » Active

There is no patch. The status is active.

slippast’s picture

Weird that this problem has been floating around for a year, but I just hit it. Anyway, the quick change from #1 fixed it.

joseph.olstad’s picture

what database driver are you using? is this postgres?

joseph.olstad’s picture

@slippast, I repeat what database driver are you using? is this postgres?

this is an important piece of information required to assess this issue.

slippast’s picture

Joseph, 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.

joseph.olstad’s picture

joseph.olstad’s picture

Title: I can't see any files in content/files tab and i got an error » postgresql support - content files count - see files in content/files tab without error
Version: 7.x-2.11 » 7.x-2.25
Assigned: Unassigned » joseph.olstad
Status: Active » Needs review
joseph.olstad’s picture

should 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.

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed
joseph.olstad’s picture

ya SUM of count redundant.

what is the SUM of 10 ? if count(fu.count) is 10?

so ya, patched, thanks for the patch!

Status: Fixed » Closed (fixed)

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