Closed (fixed)
Project:
Webform Protected Downloads
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 May 2011 at 12:09 UTC
Updated:
9 Oct 2011 at 10:07 UTC
I'm getting this warning in both the admin and anon visitor view for any webforms I create:
Notice: Undefined property: stdClass::$wpd_valid in webform_protected_downloads_form_alter() (line 876 of xxxxxxxxxxxx/httpdocs/sites/all/modules/webform_protected_downloads/webform_protected_downloads.module).
Comments
Comment #1
berliner commentedAh, I see, you configured node types other than the default webform node type to be wenform enabled, right? My module didn't cope with this up to now. I fixed this now in the dev version.
Comment #2
ClaudeS-1 commentedI got this error again with the May 14th dev build - different line number now
Notice: Undefined property: stdClass::$wpd_valid in webform_protected_downloads_form_alter() (line 866 of xxxxx/httpdocs/sites/all/modules/webform_protected_downloads/webform_protected_downloads.module).
Comment #3
berliner commentedCan you give me more information about the context? This time I can't reproduce the warnings.
Comment #4
ClaudeS-1 commentedNothing especially helpful. A "Product" content-type node was being edited, lots of fields filled, and the notice appeared when the form was submitted. On returning to the page, all the fields were empty.
However, "Product" isn't a webform-enabled content type. Perhaps some invalid check is letting your module code be called on content-types where it shouldn't be called?
Comment #5
berliner commentedhm, that sounds strange and not particularly easy to reproduce. The warning is generated inside the following confition in hook_form_alter:
So I would suppose that it triggers only for webform forms. Honestly I have no idea why it should trigger for non-webform forms.
Do you feel like debugging this a bit by any chance? Would be helpful to solve this issue. Like e.g. checking the value of $form_id in the given scenario to see where it comes from.
Comment #6
ClaudeS-1 commentedI added a debug line and found these values in $form_id:
comment_node_product_form_form_id: search_block_form_form_id: webform_client_form_93
The last one is the culprit, it's a simple Webform contact form displayed in a block in the footer of the page.
I enabled webform for Basic Page, made a contact form, and displayed it as a block. There are no protected downloads configured for the form.
Comment #7
berliner commentedThanks for digging into this. With those information I was able to fix the issue.
Comment #9
qsurti commentedI am getting the same problem:
"Notice: Undefined property: stdClass::$wpd_valid in webform_protected_downloads_form_alter() (line 876 of /home/diamonds/public_html/d/sites/all/modules/webform_protected_downloads/webform_protected_downloads.module)."
I am using Webform Protected Download ver 7.x-1.0-alpha1. The Notice appears when I edit ubercart Product node.
If I edit the webform and add few new fields, would the data be saved and will the program function properly or should I wait till this issue is fixed?