The $data array doesn't include all of the components in the webform. The only way I can get around it is by using the $node object and doing a funky foreach loop on each component in that object.

See comparison.

$node


stdClass Object
(
    [vid] => 778
    [uid] => 1
    [title] => Apply for Certification
    [log] => 
    [status] => 1
    [comment] => 1
    [promote] => 0
    [sticky] => 0
    [nid] => 267
    [type] => webform
    [language] => en
    [created] => 1332807027
    [changed] => 1332886382
    [tnid] => 267
    [translate] => 0
    [revision_timestamp] => 1332886382
    [revision_uid] => 1
    [body] => Array
        (
            [und] => Array
                (
                    [0] => Array
                        (
                            [value] => 

Congratulations on taking the first step toward CCOF organic certification! Please fill out the following information as accurately and completely as possible so that we can assemble a custom packet for you containing all of the certification application forms specific to your operation.


                            [summary] => 
                            [format] => full_html
                            [safe_value] => 

Congratulations on taking the first step toward CCOF organic certification! Please fill out the following information as accurately and completely as possible so that we can assemble a custom packet for you containing all of the certification application forms specific to your operation.


                            [safe_summary] => 
                        )

                )

        )

    [metatags] => Array
        (
        )

    [rdf_mapping] => Array
        (
            [rdftype] => Array
                (
                    [0] => sioc:Item
                    [1] => foaf:Document
                )

            [title] => Array
                (
                    [predicates] => Array
                        (
                            [0] => dc:title
                        )

                )

            [created] => Array
                (
                    [predicates] => Array
                        (
                            [0] => dc:date
                            [1] => dc:created
                        )

                    [datatype] => xsd:dateTime
                    [callback] => date_iso8601
                )

            [changed] => Array
                (
                    [predicates] => Array
                        (
                            [0] => dc:modified
                        )

                    [datatype] => xsd:dateTime
                    [callback] => date_iso8601
                )

            [body] => Array
                (
                    [predicates] => Array
                        (
                            [0] => content:encoded
                        )

                )

            [uid] => Array
                (
                    [predicates] => Array
                        (
                            [0] => sioc:has_creator
                        )

                    [type] => rel
                )

            [name] => Array
                (
                    [predicates] => Array
                        (
                            [0] => foaf:name
                        )

                )

            [comment_count] => Array
                (
                    [predicates] => Array
                        (
                            [0] => sioc:num_replies
                        )

                    [datatype] => xsd:integer
                )

            [last_activity] => Array
                (
                    [predicates] => Array
                        (
                            [0] => sioc:last_activity_date
                        )

                    [datatype] => xsd:dateTime
                    [callback] => date_iso8601
                )

        )

    [webform] => Array
        (
            [nid] => 267
            [confirmation] => 
            [confirmation_format] => plain_text
            [redirect_url] => apply-certification/download/%post[operation_type]/%post[mail_delivery]
            [status] => 1
            [block] => 0
            [teaser] => 0
            [allow_draft] => 0
            [auto_save] => 1
            [submit_notice] => 1
            [submit_text] => Submit & Get Forms
            [submit_limit] => -1
            [submit_interval] => -1
            [total_submit_limit] => -1
            [total_submit_interval] => -1
            [record_exists] => 1
            [roles] => Array
                (
                    [0] => 1
                    [1] => 2
                )

            [emails] => Array
                (
                )

            [components] => Array
                (
                    [12] => Array
                        (
                            [nid] => 267
                            [cid] => 12
                            [pid] => 0
                            [form_key] => page_1_header
                            [name] => Page 1 - Header
                            [type] => markup
                            [value] => 
Contact Info

* Required fields

( page 1 of 3 )

                            [extra] => Array
                                (
                                    [format] => plain_text
                                    [private] => 
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 0
                            [page_num] => 1
                        )

                    [1] => Array
                        (
                            [nid] => 267
                            [cid] => 1
                            [pid] => 0
                            [form_key] => first_name
                            [name] => First Name
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 1
                            [page_num] => 1
                        )

                    [2] => Array
                        (
                            [nid] => 267
                            [cid] => 2
                            [pid] => 0
                            [form_key] => last_name
                            [name] => Last Name
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 2
                            [page_num] => 1
                        )

                    [4] => Array
                        (
                            [nid] => 267
                            [cid] => 4
                            [pid] => 0
                            [form_key] => your_title
                            [name] => Your Title
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 3
                            [page_num] => 1
                        )

                    [5] => Array
                        (
                            [nid] => 267
                            [cid] => 5
                            [pid] => 0
                            [form_key] => operation_name
                            [name] => Operation Name
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 4
                            [page_num] => 1
                        )

                    [6] => Array
                        (
                            [nid] => 267
                            [cid] => 6
                            [pid] => 0
                            [form_key] => address
                            [name] => Address
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 5
                            [page_num] => 1
                        )

                    [7] => Array
                        (
                            [nid] => 267
                            [cid] => 7
                            [pid] => 0
                            [form_key] => city
                            [name] => City
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 6
                            [page_num] => 1
                        )

                    [8] => Array
                        (
                            [nid] => 267
                            [cid] => 8
                            [pid] => 0
                            [form_key] => state_region
                            [name] => State\Region
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 7
                            [page_num] => 1
                        )

                    [9] => Array
                        (
                            [nid] => 267
                            [cid] => 9
                            [pid] => 0
                            [form_key] => zip_postal_code
                            [name] => ZIP/Postal Code
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 8
                            [page_num] => 1
                        )

                    [10] => Array
                        (
                            [nid] => 267
                            [cid] => 10
                            [pid] => 0
                            [form_key] => country
                            [name] => Country
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 9
                            [page_num] => 1
                        )

                    [11] => Array
                        (
                            [nid] => 267
                            [cid] => 11
                            [pid] => 0
                            [form_key] => mail_delivery
                            [name] => Mail Delivery
                            [type] => select
                            [value] => 0
                            [extra] => Array
                                (
                                    [items] => 1|Yes
0|No

                                    [multiple] => 
                                    [aslist] => 
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => Receive your application packet in the mail in addition to downloading online?
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 10
                            [page_num] => 1
                        )

                    [13] => Array
                        (
                            [nid] => 267
                            [cid] => 13
                            [pid] => 0
                            [form_key] => phone
                            [name] => Phone
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => Please format: 123-456-7890
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 11
                            [page_num] => 1
                        )

                    [14] => Array
                        (
                            [nid] => 267
                            [cid] => 14
                            [pid] => 0
                            [form_key] => email_address
                            [name] => Email Address
                            [type] => email
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [unique] => 0
                                    [disabled] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 12
                            [page_num] => 1
                        )

                    [15] => Array
                        (
                            [nid] => 267
                            [cid] => 15
                            [pid] => 0
                            [form_key] => confirm_email_address
                            [name] => Confirm Email Address
                            [type] => email
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [unique] => 0
                                    [disabled] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 13
                            [page_num] => 1
                        )

                    [16] => Array
                        (
                            [nid] => 267
                            [cid] => 16
                            [pid] => 0
                            [form_key] => website_address
                            [name] => Website Address
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => If applicable
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 14
                            [page_num] => 1
                        )

                    [31] => Array
                        (
                            [nid] => 267
                            [cid] => 31
                            [pid] => 0
                            [form_key] => page_break_1
                            [name] => Page break 1
                            [type] => pagebreak
                            [value] => 
                            [extra] => Array
                                (
                                    [private] => 
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 15
                            [page_num] => 2
                        )

                    [18] => Array
                        (
                            [nid] => 267
                            [cid] => 18
                            [pid] => 0
                            [form_key] => page_2_header
                            [name] => Page 2 - Header
                            [type] => markup
                            [value] => 
Operation Info

* Required fields

( page 2 of 3 )

                            [extra] => Array
                                (
                                    [format] => plain_text
                                    [private] => 
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 16
                            [page_num] => 2
                        )

                    [21] => Array
                        (
                            [nid] => 267
                            [cid] => 21
                            [pid] => 0
                            [form_key] => operation_type
                            [name] => Operation Type
                            [type] => select
                            [value] => 
                            [extra] => Array
                                (
                                    [items] => 49|Grower
52|Livestock producer
50|Processor/Handler
54|Retail or Restaurant
394|Trader/Broker/Private label owner
395|I am not an organic operation

                                    [multiple] => 1
                                    [aslist] => 
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => Please tell us what type of operation you have (check all that apply, at least one is required)
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 17
                            [page_num] => 2
                        )

                    [20] => Array
                        (
                            [nid] => 267
                            [cid] => 20
                            [pid] => 0
                            [form_key] => more_information
                            [name] => Additional Information
                            [type] => textarea
                            [value] => 
                            [extra] => Array
                                (
                                    [cols] => 60
                                    [rows] => 5
                                    [title_display] => before
                                    [resizable] => 1
                                    [disabled] => 0
                                    [description] => Please tell us more about your operation so we can ensure you get everything you need.
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 18
                            [page_num] => 2
                        )

                    [22] => Array
                        (
                            [nid] => 267
                            [cid] => 22
                            [pid] => 0
                            [form_key] => information_on_foreign_certification
                            [name] => Do you need information on foreign certification?
                            [type] => select
                            [value] => 
                            [extra] => Array
                                (
                                    [items] => foreign_export_products|Yes, I may export organic products
foreign_sell_export_products|Yes, I may sell my products to others who may eventually export them
foreign_asked_certification|Yes, I have been asked for foreign organic certification

                                    [multiple] => 1
                                    [aslist] => 
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => If so, please let us know why (check all that apply)
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 19
                            [page_num] => 2
                        )

                    [30] => Array
                        (
                            [nid] => 267
                            [cid] => 30
                            [pid] => 0
                            [form_key] => page_break_2
                            [name] => Page break 2
                            [type] => pagebreak
                            [value] => 
                            [extra] => Array
                                (
                                    [private] => 
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 20
                            [page_num] => 3
                        )

                    [23] => Array
                        (
                            [nid] => 267
                            [cid] => 23
                            [pid] => 0
                            [form_key] => page_3_header
                            [name] => Page 3 - header
                            [type] => markup
                            [value] => 
Additional Info

* Required fields

( page 3 of 3 )

                            [extra] => Array
                                (
                                    [format] => plain_text
                                    [private] => 
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 21
                            [page_num] => 3
                        )

                    [24] => Array
                        (
                            [nid] => 267
                            [cid] => 24
                            [pid] => 0
                            [form_key] => certified_another_certifier
                            [name] => Are you currently certified with another certifier?
                            [type] => select
                            [value] => 
                            [extra] => Array
                                (
                                    [items] => 1|Yes
0|No

                                    [multiple] => 
                                    [aslist] => 
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => 
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 22
                            [page_num] => 3
                        )

                    [25] => Array
                        (
                            [nid] => 267
                            [cid] => 25
                            [pid] => 0
                            [form_key] => name_of_other_certifier
                            [name] => Name of other certifier
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => Ignore if you didn't select "yes" to the question above.
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 23
                            [page_num] => 3
                        )

                    [26] => Array
                        (
                            [nid] => 267
                            [cid] => 26
                            [pid] => 0
                            [form_key] => how_did_you_hear_about_ccof
                            [name] => How did you hear about CCOF?
                            [type] => select
                            [value] => 
                            [extra] => Array
                                (
                                    [items] => 0|CCOF Client
1|Trade Show
2|Web Search
3|Word of Mouth

                                    [multiple] => 
                                    [aslist] => 1
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => 
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 24
                            [page_num] => 3
                        )

                    [27] => Array
                        (
                            [nid] => 267
                            [cid] => 27
                            [pid] => 0
                            [form_key] => newsletter_signup
                            [name] => Would you like to subscribe to the CCOF E-Newsletter?
                            [type] => select
                            [value] => 1
                            [extra] => Array
                                (
                                    [items] => 1|Yes
0|No

                                    [multiple] => 
                                    [aslist] => 
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => 
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 25
                            [page_num] => 3
                        )

                    [28] => Array
                        (
                            [nid] => 267
                            [cid] => 28
                            [pid] => 0
                            [form_key] => additional_comments_or_questions
                            [name] => Additional comments or questions
                            [type] => textarea
                            [value] => 
                            [extra] => Array
                                (
                                    [cols] => 60
                                    [rows] => 5
                                    [title_display] => before
                                    [resizable] => 1
                                    [disabled] => 0
                                    [description] => Please let us know if you have any additional comments or questions.
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 26
                            [page_num] => 3
                        )

                    [29] => Array
                        (
                            [nid] => 267
                            [cid] => 29
                            [pid] => 0
                            [form_key] => require_expedited_certifcation_program
                            [name] => Require Expedited Certifcation Program
                            [type] => select
                            [value] => 
                            [extra] => Array
                                (
                                    [items] => yes|Yes

                                    [multiple] => 1
                                    [aslist] => 
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => Check here if you need to take advantage of CCOF's Expedited Certification Program. (What is this?)
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 27
                            [page_num] => 3
                        )

                )

        )

    [cid] => 0
    [last_comment_timestamp] => 1332807027
    [last_comment_name] => 
    [last_comment_uid] => 1
    [comment_count] => 0
    [name] => system
    [picture] => 28
    [data] => b:0;
    [entity_view_prepared] => 1
    [content] => Array
        (
            [body] => Array
                (
                    [#theme] => field
                    [#weight] => 0
                    [#title] => Body
                    [#access] => 1
                    [#label_display] => hidden
                    [#view_mode] => full
                    [#language] => und
                    [#field_name] => body
                    [#field_type] => text_with_summary
                    [#field_translatable] => 0
                    [#entity_type] => node
                    [#bundle] => webform
                    [#object] => stdClass Object
 *RECURSION*
                    [#items] => Array
                        (
                            [0] => Array
                                (
                                    [value] => 

Congratulations on taking the first step toward CCOF organic certification! Please fill out the following information as accurately and completely as possible so that we can assemble a custom packet for you containing all of the certification application forms specific to your operation.


                                    [summary] => 
                                    [format] => full_html
                                    [safe_value] => 

Congratulations on taking the first step toward CCOF organic certification! Please fill out the following information as accurately and completely as possible so that we can assemble a custom packet for you containing all of the certification application forms specific to your operation.


                                    [safe_summary] => 
                                )

                        )

                    [#formatter] => text_default
                    [0] => Array
                        (
                            [#markup] => 

Congratulations on taking the first step toward CCOF organic certification! Please fill out the following information as accurately and completely as possible so that we can assemble a custom packet for you containing all of the certification application forms specific to your operation.


                        )

                )

            [#pre_render] => Array
                (
                    [0] => _field_extra_fields_pre_render
                    [1] => field_group_build_pre_render
                )

            [#entity_type] => node
            [#bundle] => webform
            [metatags] => Array
                (
                    [title] => Array
                        (
                            [#attached] => Array
                                (
                                    [metatag_set_preprocess_variable] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [0] => html
                                                    [1] => head_title
                                                    [2] => Apply for Certification | CCOF
                                                )

                                            [1] => Array
                                                (
                                                    [0] => html
                                                    [1] => head_array
                                                    [2] => Array
                                                        (
                                                            [title] => Apply for Certification | CCOF
                                                        )

                                                )

                                        )

                                )

                        )

                    [description] => Array
                        (
                        )

                    [keywords] => Array
                        (
                            [#attached] => Array
                                (
                                    [drupal_add_html_head] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [#theme] => metatag
                                                            [#tag] => meta
                                                            [#id] => metatag_keywords
                                                            [#name] => keywords
                                                            [#value] => California Certified Organic Farmers, certified organic growers, CCOF, certified organic food, organic farms, National Organic Program, NOP, organic agriculture, organic certification agency, organic certification services, organic certification standards
                                                        )

                                                    [1] => metatag_keywords
                                                )

                                        )

                                )

                        )

                    [generator] => Array
                        (
                            [#attached] => Array
                                (
                                    [drupal_add_html_head] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [#theme] => metatag
                                                            [#tag] => meta
                                                            [#id] => metatag_generator
                                                            [#name] => generator
                                                            [#value] => Drupal 7 (http://drupal.org)
                                                            [#attached] => Array
                                                                (
                                                                    [drupal_add_http_header] => Array
                                                                        (
                                                                            [0] => Array
                                                                                (
                                                                                    [0] => X-Generator
                                                                                    [1] => Drupal 7 (http://drupal.org)
                                                                                )

                                                                        )

                                                                )

                                                        )

                                                    [1] => metatag_generator
                                                )

                                        )

                                )

                        )

                    [#field_type] => 
                )

            [#groups] => Array
                (
                )

            [#fieldgroups] => Array
                (
                )

            [#group_children] => Array
                (
                )

            [links] => Array
                (
                    [#theme] => links__node
                    [#pre_render] => Array
                        (
                            [0] => drupal_pre_render_links
                        )

                    [#attributes] => Array
                        (
                            [class] => Array
                                (
                                    [0] => links
                                    [1] => inline
                                )

                        )

                    [node] => Array
                        (
                            [#theme] => links__node__node
                            [#links] => Array
                                (
                                )

                            [#attributes] => Array
                                (
                                    [class] => Array
                                        (
                                            [0] => links
                                            [1] => inline
                                        )

                                )

                        )

                )

        )

)

Verses the $data array:

$data

Array
(
    [op] => submit
    [sid] => 53
    [components] => Array
        (
            [first_name] => Array
                (
                    [value] => a
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 1
                            [pid] => 0
                            [form_key] => first_name
                            [name] => First Name
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 1
                            [page_num] => 1
                        )

                )

            [last_name] => Array
                (
                    [value] => a
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 2
                            [pid] => 0
                            [form_key] => last_name
                            [name] => Last Name
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 2
                            [page_num] => 1
                        )

                )

            [your_title] => Array
                (
                    [value] => 
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 4
                            [pid] => 0
                            [form_key] => your_title
                            [name] => Your Title
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 3
                            [page_num] => 1
                        )

                )

            [operation_name] => Array
                (
                    [value] => 
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 5
                            [pid] => 0
                            [form_key] => operation_name
                            [name] => Operation Name
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 4
                            [page_num] => 1
                        )

                )

            [address] => Array
                (
                    [value] => a
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 6
                            [pid] => 0
                            [form_key] => address
                            [name] => Address
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 5
                            [page_num] => 1
                        )

                )

            [city] => Array
                (
                    [value] => a
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 7
                            [pid] => 0
                            [form_key] => city
                            [name] => City
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 6
                            [page_num] => 1
                        )

                )

            [state_region] => Array
                (
                    [value] => a
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 8
                            [pid] => 0
                            [form_key] => state_region
                            [name] => State\Region
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 7
                            [page_num] => 1
                        )

                )

            [zip_postal_code] => Array
                (
                    [value] => a
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 9
                            [pid] => 0
                            [form_key] => zip_postal_code
                            [name] => ZIP/Postal Code
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 8
                            [page_num] => 1
                        )

                )

            [country] => Array
                (
                    [value] => a
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 10
                            [pid] => 0
                            [form_key] => country
                            [name] => Country
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 9
                            [page_num] => 1
                        )

                )

            [mail_delivery] => Array
                (
                    [value] => 0
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 11
                            [pid] => 0
                            [form_key] => mail_delivery
                            [name] => Mail Delivery
                            [type] => select
                            [value] => 0
                            [extra] => Array
                                (
                                    [items] => 1|Yes
0|No

                                    [multiple] => 
                                    [aslist] => 
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => Receive your application packet in the mail in addition to downloading online?
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 10
                            [page_num] => 1
                        )

                )

            [phone] => Array
                (
                    [value] => a
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 13
                            [pid] => 0
                            [form_key] => phone
                            [name] => Phone
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => Please format: 123-456-7890
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 11
                            [page_num] => 1
                        )

                )

            [email_address] => Array
                (
                    [value] => test@example.com
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 14
                            [pid] => 0
                            [form_key] => email_address
                            [name] => Email Address
                            [type] => email
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [unique] => 0
                                    [disabled] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 12
                            [page_num] => 1
                        )

                )

            [confirm_email_address] => Array
                (
                    [value] => test@example.com
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 15
                            [pid] => 0
                            [form_key] => confirm_email_address
                            [name] => Confirm Email Address
                            [type] => email
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [unique] => 0
                                    [disabled] => 0
                                    [title_display] => before
                                    [description] => 
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 13
                            [page_num] => 1
                        )

                )

            [website_address] => Array
                (
                    [value] => 
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 16
                            [pid] => 0
                            [form_key] => website_address
                            [name] => Website Address
                            [type] => textfield
                            [value] => 
                            [extra] => Array
                                (
                                    [width] => 
                                    [maxlength] => 
                                    [field_prefix] => 
                                    [field_suffix] => 
                                    [disabled] => 0
                                    [unique] => 0
                                    [title_display] => before
                                    [description] => If applicable
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 14
                            [page_num] => 1
                        )

                )

            [operation_type] => Array
                (
                    [value] => Array
                        (
                            [0] => 49
                            [1] => 52
                            [2] => 50
                            [3] => 54
                            [4] => 394
                            [5] => 395
                        )

                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 21
                            [pid] => 0
                            [form_key] => operation_type
                            [name] => Operation Type
                            [type] => select
                            [value] => 
                            [extra] => Array
                                (
                                    [items] => 49|Grower
52|Livestock producer
50|Processor/Handler
54|Retail or Restaurant
394|Trader/Broker/Private label owner
395|I am not an organic operation

                                    [multiple] => 1
                                    [aslist] => 
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => Please tell us what type of operation you have (check all that apply, at least one is required)
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 1
                            [weight] => 17
                            [page_num] => 2
                        )

                )

            [more_information] => Array
                (
                    [value] => aaaaaaaaaaaaaaaaaaa
                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 20
                            [pid] => 0
                            [form_key] => more_information
                            [name] => Additional Information
                            [type] => textarea
                            [value] => 
                            [extra] => Array
                                (
                                    [cols] => 60
                                    [rows] => 5
                                    [title_display] => before
                                    [resizable] => 1
                                    [disabled] => 0
                                    [description] => Please tell us more about your operation so we can ensure you get everything you need.
                                    [attributes] => Array
                                        (
                                        )

                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 18
                            [page_num] => 2
                        )

                )

            [information_on_foreign_certification] => Array
                (
                    [value] => Array
                        (
                            [0] => foreign_export_products
                            [1] => foreign_sell_export_products
                            [2] => foreign_asked_certification
                        )

                    [component] => Array
                        (
                            [nid] => 267
                            [cid] => 22
                            [pid] => 0
                            [form_key] => information_on_foreign_certification
                            [name] => Do you need information on foreign certification?
                            [type] => select
                            [value] => 
                            [extra] => Array
                                (
                                    [items] => foreign_export_products|Yes, I may export organic products
foreign_sell_export_products|Yes, I may sell my products to others who may eventually export them
foreign_asked_certification|Yes, I have been asked for foreign organic certification

                                    [multiple] => 1
                                    [aslist] => 
                                    [optrand] => 0
                                    [other_option] => 
                                    [other_text] => Other...
                                    [title_display] => before
                                    [description] => If so, please let us know why (check all that apply)
                                    [custom_keys] => 
                                    [options_source] => 
                                    [private] => 0
                                    [conditional_component] => 
                                    [conditional_operator] => =
                                    [conditional_values] => 
                                )

                            [mandatory] => 0
                            [weight] => 19
                            [page_num] => 2
                        )

                )

        )

)

The webform has two pagebreak form elements and interestingly enough the $data array only contains components from the first and second pages... the 3rd page of fields is missing.

Suggestions, recommendations?

CommentFileSizeAuthor
#5 webform_rules-1510288-5817716.patch485 bytesemptyvoid

Comments

emptyvoid’s picture

my code is not appearing in the issue? WTF?

emptyvoid’s picture

Issue summary: View changes

trying to get issue to appear..

milos.kroulik’s picture

Well, I think that documentation is misleading here. I was finally able to access the value like:

print $data['components']['[your_field_key]']['value'][0];
stborchert’s picture

@emptyvoid: you can use code and php tags here to insert code. If this doesn't work paste your code to http://drupalbin.com and link it here.

To see the complete structure of the submission, install Devel and then use <?php dpm($data); ?> in your rule. This will lead you to something like the example posted by Miloš.

emptyvoid’s picture

Hello,
Well I couldn't share the different in structure from the $node object and the $data array. But after spending some time debugging the code I determined the following:

1) $node object
This object provides all of the components in the webform as you built it. The key thing to understand is the $node object provides the components and the default values of each. I made the mistake of assuming that it actually contained the submission data for the user's submission. It does not so you can't base business logic on the values as it will always be the default.

2) $data object
This is the object you'll want to use, the problem I found was for some reason while the webform_rules_client_form_submit($form, &$form_state) function is called the $submission object looses the last page of components and sadly the tokens don't exists because the $submission object looses the scope for the fields. So I added a little logic to include the components if they are missing and now everything I need appears during the rule evaluation!


 if ($form['#is_draft'] && isset($form_state['values']['details']['sid'])) {
    $submission = $form['#submission'];
    // Map submitted data to submission data.
    foreach ($form_state['values']['submitted'] as $cid => $value) {
      if (isset($submission->data[$cid])) {
        $submission->data[$cid]['value'] = $value;
      } else {
        $submission->data[$cid] = array('value' => $value);
      }
    }
    // Invoke event.
    webform_rules_rules_invoke_event($submission, $form['#node'], 'submit');
  }

Please review and let me know if this may generate errors or issues with the integrity of the objects.

Attaching a patch shortly.

emptyvoid’s picture

Status: Active » Needs review
StatusFileSize
new485 bytes

patch as promised.

emptyvoid’s picture

Version: 7.x-1.x-dev » 7.x-1.3

Changing version to what I'm using.

stborchert’s picture

Version: 7.x-1.3 » 7.x-1.x-dev

Could you somehow export your webform configuration (e.g. make a Feature with Default content and attach it here) or explain the structure of the webform in detail? I've tried to reproduce the error but couldn't force this.

(btw. patches are made against development versions since releases do not change after creation)

stborchert’s picture

Status: Needs review » Postponed (maintainer needs more info)
stborchert’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
stborchert’s picture

Issue summary: View changes

adding php tag instead of code