Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello
When I activate the dropdown list I have this warning.
Comment | File | Size | Author |
---|---|---|---|
#13 | paging-drop_down_pager_throws_first_last_errors-378558-13.patch | 2.88 KB | jenlampton |
#5 | paging.patch | 932 bytes | a.a.egoroff |
Comments
Comment #1
boaz_r CreditAttribution: boaz_r commentedThis issue is not related to the specific module, but from hours we spent trying to find out why the this happens, we saw that when you put a "#maxlength" property on a "confirm_password" field this issue arise.
Note that according to FAPI (http://api.drupal.org/api/file/developer/topics/forms_api_reference.html...), #maxlength should be defined only for textfield elements. Remove this property from the password_confirm form element, and you're clear for takeoff.
Comment #2
Gurpartap Singh CreditAttribution: Gurpartap Singh commentedBut there's no password field used in paging. It might something related. Let's see.
Comment #3
boaz_r CreditAttribution: boaz_r commentedI bet its something similar. I would have checked that:
* does the presented page have forms within? I so, carefully check the form's definition. Make sure #maxlength is defined ONLY on textfield form elements.
* I would have also possibly patched the offending source file (unicode.inc), in order to catch and (temporarily) resolve all such possible bugs, with something like:
Comment #4
Gurpartap Singh CreditAttribution: Gurpartap Singh commentedAccording to above explanations, the problems doesn't look like to be emerging from paging. Nor I have any other clue what might be the cause.
Comment #5
a.a.egoroff CreditAttribution: a.a.egoroff commentedHi, friends. t(...) is not needed:) Patch attached, it also solves the problem described above, which occurred to me too.
Comment #6
daltro CreditAttribution: daltro commentedIs this the right patch file? I don't think so. But it solved the problem manually removing the t(...) from the .module file on the specified lines. Thanks a lot!
Comment #7
drifter CreditAttribution: drifter commentedYes, I can confirm the bug. It occurs when viewing the first and last pages, and the pager is set to a dropdown. t() will return an array if $page_names is called with an invalid offset (negative or larger than the last page), thus breaking truncate_utf8.
Agree that t() is not necessary here, however it still shouldn't be called with invalid indexes. An alternate take:
Comment #8
drifter CreditAttribution: drifter commentedComment #9
gary.evans CreditAttribution: gary.evans commentedI had a blank string as the first parameter of the t() function, like this t(''). I replaced it with '' and the error went away.
--g
Comment #10
mugginsoft.net CreditAttribution: mugginsoft.net commentedYou will also witness this behaviour if you inadvertently define #maxlength for a form date field.
Comment #11
mdshields CreditAttribution: mdshields commentedThanks Muggin, you saved the day!
Comment #12
Augusto182 CreditAttribution: Augusto182 commented:)
*SOLVED*
Comment #13
jenlamptonI'm unable to confirm that this issue is still a problem (has t() been fixed?) But I like the solution in #7 where we only calculate previous and next links when they are needed. We should also only add the links to the page if they exist... how about something like the attached?
Comment #14
NancyDru