The Expired Users list provided by this module only shows 10 lines per page; this results in a large number of pages to go through. If you don't want to put in a setting somewhere, then please use the system "default_nodes_main" setting.
Line 1068
$query = db_select('password_policy_expiration', 'p', array('target' => 'slave'));
$query->innerJoin('users', 'u', 'p.uid = u.uid');
$result = $query->fields('p')
->fields('u', array('name'))
->condition('p.blocked', 0, '>')
->extend('PagerDefault')
->extend('TableSort')
->limit(variable_get('default_nodes_main', 10)) // <<----------
->orderByHeader($header)
->execute();
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | password_policy-7.x-1.x-add_entries_per_page_setting-2984616-7.patch | 2.19 KB | aohrvetpv |
| #6 | Lines_per_page_setting-2984616-6.patch | 2.1 KB | nancydru |
| #4 | Lines_per_page_setting-2984616-4.patch | 1.66 KB | nancydru |
Comments
Comment #2
aohrvetpv commentedNancyDru, for your sites, what would you set it to, if it were a setting?
I'm wondering if we could just change the default. If your sites have so many users you would set it to 100 or something, maybe it should be a setting, because we probably wouldn't want the default to be 100.
I'm not sure it should be tied to
default_nodes_main, because people might increase that and not expect it to change the number of items per page for unrelated things, right?Comment #3
nancydruCurrently I have it set to 20 which still generates 29 pages. Yes, it should be a setting. I will try to produce a patch for that.
Comment #4
nancydruOkay, here is a patch that adds a setting for the number of lines per page.
Comment #5
aohrvetpv commentedThanks for the patch! Variable should be deleted upon uninstall.
Comment #6
nancydruHere you go
Comment #7
aohrvetpv commentedThank you.
Changes from #6:
- Added validation to ensure a positive integer.
- Moved setting into "Expiration settings" fieldset. I'd like to move the notification settings here too later. I think it'd be better to have all the expiration-related stuff in one fieldset.
- Changed description to describe the page and give a link to it. I think new users of the module may not know what page we're talking about.
- Changed "lines" to "entries". This is probably the more proper term. When there are no expired accounts, the table says "No entries".
- Changed abbreviated "acct" in variable name to "account". I suppose you were trying to avoid a long variable name, but I'd rather be consistent with the rest of the code which spells out "account", to avoid mental mapping (https://github.com/jupeter/clean-code-php#avoid-mental-mapping).
Please review/test!
Comment #8
nancydruLooks good to me.
Comment #10
aohrvetpv commentedMaybe this would be better as a select list on the "Expired accounts" page that lets you choose the number of entries per page. I'm not sure if any other tables in Drupal or popular contributed modules do that. Then we would not have to have a setting in the administration interface.
This solves the problem for now, at least.
Comment #11
nancydruThanks.
It's kind of like the "Nodes on front page" ('default_nodes_main') setting.