Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The paging information (page number and page count) disappeared from version 3.x in $form.
That information can be used for any extended page handling. For example, this info is passed to webform-form.tpl.php and can be used to display the user's progress through the webform.
Comment | File | Size | Author |
---|---|---|---|
#1 | webform.module_817204.patch | 812 bytes | khaled.zaidan |
Comments
Comment #1
khaled.zaidan CreditAttribution: khaled.zaidan commentedComment #2
quicksketchIt's not in $form but it is in $form_state I believe. I'll need to see if this information is redundant or not.
Comment #3
khaled.zaidan CreditAttribution: khaled.zaidan commentedYes it is in the $form_state. But the problem is that when the form is first created (you're still on the first page, and you still never pressed next or previous) there is no $form_state at all, so the paging info isn't available unless added to the form itself (like in the patch).
Comment #4
miro_dietikerConfirm this is needed on $form.
Comment #5
quicksketchThis is not true. $form_state is the second parameter of hook_form_alter(): http://api.lullabot.com/hook_form_alter/6.
In a custom module hook_form_alter() I've confirmed that $form_state['webform']['page_num'] exists even on the first page of the form.
I'd like to avoid adding redudant information to the $form array if it serves no purpose. If you can explain a situation where the existing information is not enough I'll take another look at this.
Comment #6
quicksketchAh, of course, when theming $form_state is not available (which is why this is a prerequisite for #258696: Multipage form - Page n of n (progress or percentage complete)). I've committed to both 3.x branches. Thanks for your patience on this.