Hello quicksketch,
I couldn't find a solution, so I've created the issue.

I'm using Webform 7.x-3.18 on D7.14 Bartik theme. The form is just a 1-step-webform. It's created as a 'quick question/help desk' box.

User fills in few fields:
name [textfield],
email [email field],
subject/title of a query [user chooses one from a select list - 1 option only, no multi-select available]
and the body [textarea].

Everything is almost all right. After filling in the form ang hitting 'send' button confirmation message appears, email is sent.
But along with the confirmation message, there's one more, above it saying:

Notice: Undefined index: #webform_component in theme_webform_display_select()...

corresponding to webform/components/select.inc line 546 which is:

$component = $element['#webform_component'];

Any ideas how to fix it?

Thx in advance

Edit: As wrote in other issues (3.17, 3.16), this notice appears when email subject is set as one of the select list options.

Comments

quicksketch’s picture

Status: Active » Closed (duplicate)

Let's just continue working in #1462986: Undefined index: #webform_component in select.inc, where several others have already provided input. I've changed that issue to a bug report.

lusitone’s picture

Priority: Normal » Major
Status: Closed (duplicate) » Needs work

I installed Drupal 3.x-3.18 and up to date webform module.

Notice appears when following function is called:
function theme_webform_display_select($variables) {
$element = $variables['element'];
//This is the issue
$component = $element['#webform_component'];

Reason being is that select field for some reason does not have #webform_component in the array unlike other field types.
What could be the reason and how this could be addressed? I hate to see notices on the page.

Thanks.

quicksketch’s picture

Priority: Major » Normal

Hm, I'm not sure how this could be. In what situation are you experiencing this error? When viewing a submission, downloading a CSV file, submitting the form, etc? It's possible that some other module is calling theme_webform_display_select() other than Webform itself, which ensures that the #webform_component key exists:

Line numbers from 7.x-3.18:

2140     if ($display_element = webform_component_invoke($component['type'], 'display', $component, $data, $format)) {
2141       // Ensure the component is added as a property.
2142       $display_element['#webform_component'] = $component;
2143 

A notice isn't a major error in any case. If you're really, really bothered by it, you can also upgrade to Webform 4.x, which has split out the individual properties so that use of #webform_component is no longer necessary.

quicksketch’s picture

Status: Needs work » Closed (fixed)

Actually it looks like this is fixed in the 3.x branch also in #1462986: Undefined index: #webform_component in select.inc. We just need to make a new release. The last 3.x release was in May 2012, while that other issue was fixed in September 2012. So this is fixed in the code already. You can run the dev release if you're in a hurry or wait for a new 3.x release.

quicksketch’s picture

Issue summary: View changes

Comparing to other issues