Hi guys,
I recently received this error when exposing the amount of items to display (pager settings) to the user. I had set the amounts to 5, 25, 50, etc, in the "Exposed items per page options", but the amount in "Items per page" was 20. In short, Views wasn't happy that the Items per page wasn't a number in the "Exposed items per page options", but the error message "Please insert the items per page (20) from above." doesn't mane a whole lot of sense, because the message is displayed at the top of the panel. I would consider changing this to something like, "Please ensure the 'Items per page' value is the same as a value in 'Exposed items per page options'".
Thanks again for such an awesome module :)
Josh
Comment | File | Size | Author |
---|---|---|---|
#11 | 1870866-11.patch | 11.92 KB | wiifm |
Comments
Comment #1
Bojhan CreditAttribution: Bojhan commentedYup, this is a freaky error message.
Comment #2
magunz CreditAttribution: magunz commentedI've changed it to "You must have your current items per page (10) as an opition on your exposed items per page."
as per attached patch
Comment #3
magunz CreditAttribution: magunz commentedThis patch is part of the 24 March 2014 Drupal 8 codes print New Zealand event.
Comment #4
wiifmThis is a solid improvement over the existing confusing error message in views. I am definitely in favour of getting this committed. This may also be a candidate for back porting if this error message is in the D7 version of views too.
Comment #5
webchickSmall typo: "opition"
The error message also seems a bit verbose vs. our current standards (tagging to get the UX team to chime in), and when I got it, I wasn't exactly sure how to fix it, because the field that's wrong isn't identified except if you scroll down and see a red outline. Suggest something like:
"The Exposed items per page field's options must include the value from the Items per page field (@num)."
(Note: I can't remember if we italicize field names like that, but hopefully the UX team knows.)
I'm also wondering if we can scope-creep this slightly to include 50 in the default list of options? Because right now you will ALWAYS get this error message if you check "Expose items per page" because "Items per page" defaults to 50, and "Exposed items per page options*" defaults to "5, 10, 20, 40, 60."
Comment #6
wiifmChanges in this patch:
Comment #7
LinL CreditAttribution: LinL commented6: 1870866-6.patch queued for re-testing.
Comment #9
dawehnerI don't get those changes. 5, 5, 20, 10, 10 as step size makes absolutely no sense. I guess we should change the actual default value in the code as well, if we want to change them.
Comment #10
wiifmAssigning to myself to get a new patch up.
Comment #11
wiifmSo I did a bit of research as to the most popular items per page at the moment in the code base:
Based on this, I made the assumption that the items per page should be
5, 10, 25, 50
(leaving gaps of5, 5, 15, 25
which should make more sense).Patch attached that does this. Patch was made with sed
find . -type f -print0 | xargs -0 sed -i "s/'5, 10, 20, 40, 60'/'5, 10, 25, 50'/g"
Also have brought forward the message change.
Comment #12
dawehnerI really like this more logarithmic based items per page.
Comment #13
alexpottCommitted 0fe89b3 and pushed to 8.0.x. Thanks!