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)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jamiecuthill’s picture

I'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).

Dave Reid’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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