Thanks for this module, I've used and customized it quite a bit in a recent project. :)
Though I haven't used the max items feature, I think there is a bug in it.
Instead of this:
if (!empty($max_items) && count($oids) == $max_items)
I think you wanted this:
if (!empty($max_items) && count($oids) > $max_items)
A few extra stuff:
1. I think it would be really friendly to only display this message to admins (i.e. user_access('administer views')
check).
2. I don't think the code actually limits the amount of total results. Either the message should be updated to be just a notification about exceeding $max_limits
or $oids
should be actually reduced, e.g. with array_slice
.
3. Moving this entire logic into its own method would make the already pretty long get_oids()
method a bit easier to read. Also people extending this class will need to worry about a bit less code.
I'd be happy to update the patch if you think any of these make sense.
Comment | File | Size | Author |
---|---|---|---|
#2 | views_filters_selective-incorrect_max_items_check-2830564-2.patch | 700 bytes | progpapa |
Comments
Comment #2
progpapa CreditAttribution: progpapa at NDP commentedpatch attached