I am running Webform 7.x-3.9 and Webform Simplenews 7.x-1.x-dev
I have placed the component into my web form and every time the user submits the form I get these errors:
# Notice: Undefined index: render element in theme() (line 811 of /home/boycombe/public_html/includes/theme.inc).
# Notice: Undefined index: element in theme_webform_display_newsletter_email() (line 281 of /home/boycombe/public_html/sites/all/modules/webform_simplenews/webform_simplenews.inc).
# Notice: Undefined index: #format in theme_webform_display_newsletter_email() (line 283 of /home/boycombe/public_html/sites/all/modules/webform_simplenews/webform_simplenews.inc).
# Notice: Undefined index: render element in theme() (line 811 of /home/boycombe/public_html/includes/theme.inc).
# Notice: Undefined index: element in theme_webform_display_newsletter_email() (line 281 of /home/boycombe/public_html/sites/all/modules/webform_simplenews/webform_simplenews.inc).
# Notice: Undefined index: #format in theme_webform_display_newsletter_email() (line 283 of /home/boycombe/public_html/sites/all/modules/webform_simplenews/webform_simplenews.inc).
# Notice: Undefined index: render element in theme() (line 811 of /home/boycombe/public_html/includes/theme.inc).
# Notice: Undefined index: element in theme_webform_display_newsletter_email() (line 281 of /home/boycombe/public_html/sites/all/modules/webform_simplenews/webform_simplenews.inc).
# Notice: Undefined index: #format in theme_webform_display_newsletter_email() (line 283 of /home/boycombe/public_html/sites/all/modules/webform_simplenews/webform_simplenews.inc)
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | webform_undefined_error-1097428-17.patch | 761 bytes | tostinni |
Comments
Comment #1
pcambraI'm not sure of how to reproduce this, maybe the newsletter email is not required for you? Can you provide more details on how to reproduce this error?
Comment #2
Francis47 commented@Trickar:
I had the exact same issue on the exact same lines of code when using the block provided by Webform Simplenews Component.
There seemed to be no workaround for it, so i eventually used the block provided by Simplenews itself.
All there was to it was changing permissions for anonymous users, and a submit form appeared in the block.
I have no clue wether or not Webform Simplenews Component is required for this action or not.
But this approach worked for me.
Now i just need to figure out where to manage the subscriptions.
There seems to be no list to be found anywhere in the UI - but thats another topic.
Best regards
Comment #3
damiandab commentedAfter adding the form component "newsletter email" to the webform I get another message:
Notice: Undefined index: private in webform_component_edit_form() (line 430 of /var/www/vhosts/drupaltemple.com/httpdocs/exhibitionpilot/sites/all/modules/webform/includes/webform.components.inc).
Comment #4
damiandab commentedAfter submitting I get a notice:
Notice: Undefined index: render element in theme() (line 824 of /var/www/vhosts/drupaltemple.com/httpdocs/exhibitionpilot/includes/theme.inc).
Notice: Undefined index: element in theme_webform_display_newsletter_email() (line 281 of /var/www/vhosts/drupaltemple.com/httpdocs/exhibitionpilot/sites/all/modules/webform_simplenews/webform_simplenews.inc).
Notice: Undefined index: #format in theme_webform_display_newsletter_email() (line 283 of /var/www/vhosts/drupaltemple.com/httpdocs/exhibitionpilot/sites/all/modules/webform_simplenews/webform_simplenews.inc).
Notice: Undefined index: render element in theme() (line 824 of /var/www/vhosts/drupaltemple.com/httpdocs/exhibitionpilot/includes/theme.inc).
Notice: Undefined index: element in theme_webform_display_newsletter_email() (line 281 of /var/www/vhosts/drupaltemple.com/httpdocs/exhibitionpilot/sites/all/modules/webform_simplenews/webform_simplenews.inc).
Notice: Undefined index: #format in theme_webform_display_newsletter_email() (line 283 of /var/www/vhosts/drupaltemple.com/httpdocs/exhibitionpilot/sites/all/modules/webform_simplenews/webform_simplenews.inc).
Comment #5
kenppx commentedI also have same issue.
Comment #6
carwin commentedsubscribe
Comment #7
arne.olafson commentedI got that error when I already had a field named "email"
The error went away after I deleted the first regular email field
Comment #8
carwin commentedI'm pretty sure the solution to #7 isn't the source of the issue since I get this on new sites without ever having an initial "email" field attached to a webform. I think many of us are trying to use this so that we can collect other information along with newsletter subscriptions, like the user's name for instance. Are there any other modules that accomplish this with simplenews other than webform and this component?
This issue has been open since March with little or no visible progress.
Comment #9
pcambraAs I always answer to these kind of issues, patches are really welcome.
Comment #10
carwin commentedLet's get a list going of all the issues needed to move forward on a stable release. I'm pretty busy this week and weekend, but I'd like to help tackle this if I can.
Comment #11
pcambraFinally I could trace this error, and committed a fix for it.
Comment #13
ovonzio commentedI'm receiving the same error as #3: Notice: Undefined index: private in webform_component_edit_form() (linea 431 di C:\xampp\htdocs\gabbris\sites\all\modules\webform\includes\webform.components.inc).
Comment #14
pcambra#13 please make sure you're using the latest -dev version and if so, reopen this issue or open a new one with the steps to reproduce it.
Comment #15
lalit774 commentedi got same error.
Please replace following line.
version 7.x-4.0-alpha1
FILE: webform/includes/webform.components.inc
LINE NO 442
with
Comment #16
criznach commentedIt looks like the private attribute is being set to 0 on line 28 in the latest dev release. In theory, that should fix this bug. I'm not using this module, but setting the private attribute in the defaults hook fixed it for me in a client module. Can anyone confirm and close?
The solution in #15 should work, but we could also update the documentation to say you MUST set the private attribute to either 0 or 1 in the defaults hook.
Comment #17
dimmech commentedHad this same issue when adding a name field in a from.
Notice: Undefined index: private in webform_component_edit_form() (line 448 of .../includes/webform.components.inc).
I can confirm the fix in #15 as well
Comment #18
tostinni commentedUnless the private property is marked as required in the webform API, I think this should be patched directly into webform to avoid theses notices.
I made a patch from #15 to get it into webform.
Comment #19
quicksketchIf your Webform component doesn't allow the component to be used as a private field, you should set 'private' => FALSE in hook_webform_component_info(). Otherwise in you component's _webform_component_[type]() function you should the default. We specifically provide tools to prevent the need to use isset() checks all over the place and the individual components should define defaults if necessary.
Comment #20
rootworkWas the patch in #18 applied to the dev branch? I have the latest stable release and it wasn't there, and since this was all I needed I just applied the patch. But if it is present in the dev branch it would be nice to roll it into a forthcoming stable release.
Comment #21
rootworkI should specify that I was getting this error without any involvement of Simplenews (I don't have that module installed), which is why the Webform patch seemed like the right course. Specifically I was getting the
Notice: Undefined index: private in webform_component_edit_form()error.Comment #22
sanitaM commentedI have multiple newsletters enable, and the option to select them individually
#18 did not work for me. (7.x-1.x-dev)
I have multiple errors :(
Notice: Undefined index: 1249 in _webform_render_newsletter_email() (line 142 of /xxxx/www/root/sites/all/modules/webform_simplenews/webform_simplenews.inc).
Notice: Undefined index: 1250 in _webform_render_newsletter_email() (line 142 of /xxxx/www/root/sites/all/modules/webform_simplenews/webform_simplenews.inc).
Do you have any recommendations?
Comment #23
sanitaM commentedI solved the problem with an Undefined index in line 142 of webform_simplenews.inc.
I am running Webform Simplenews 7.x-1.x-dev and Webform 7.x-3.20.
I have multiple newsletters enable, and the option to select them individually.
My little patch is: