Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When file_entity_admin_files() builds the form to display on /admin/content/file page, it seems to build a pager; however, the pager and results limitation does not work because the extend() calls against the db_select() $query object are not returned correctly (per http://drupal.org/node/508796).
The following change fixes it for me (using 7.x-1.x-dev from 9/29):
'operations' => array('data' => t('Operations')),
);
- $query = db_select('file_managed', 'f');
+ $query = db_select('file_managed', 'f')->extend('PagerDefault')->extend('TableSort');
$query->join('users', 'u', 'f.uid = u.uid');
- $query->extend('PagerDefault')
- ->extend('TableSort')
- ->fields('f', array('fid'))
+ $query->fields('f', array('fid'))
->fields('u', array('uid'))
->condition('f.status', FILE_STATUS_PERMANENT)
->limit($limit)
Comment | File | Size | Author |
---|---|---|---|
#1 | file_entity_paging_fixed-1304462-1.patch | 701 bytes | jamiecuthill |
Comments
Comment #1
jamiecuthill CreditAttribution: jamiecuthill commentedI've come across this too because we have so many files that page runs out of memory due to this bug.
This needs fixing asap. Patch attached (so I can stick it in my make file).
Comment #2
Dave ReidThanks for reporting this! Fixed with http://drupalcode.org/project/file_entity.git/commit/36c694e