I got this notice twice after clicking the checkbox to enable my webform on /admin/store/settings/checkout and clicking Save Configuration. Any ideas on what might be causing it? This is using Drupal 7.12, Ubercart 3.0 release, and Webform 3.15. The form is a single mandatory checkbox.

Comments

arski’s picture

Version: 7.x-3.6 » 7.x-3.x-dev
Category: support » bug
Status: Active » Fixed

Thanks for this, the webform node body wasn't fetched quite smartly enough in several places across the module. Fix committed, should be all good now.

PS. This will not have affected the structure/content of your webform submissions, as this was just a display bug.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bancarddata’s picture

Version: 7.x-3.x-dev » 7.x-3.8
Status: Closed (fixed) » Active

Sorry for the late reply but I still seem to be getting this - I am now running 7.x-3.8. Different line number:

Notice: Undefined index: safe_value in uc_webform_pane_uc_order_pane() (line 347 of /opt/apache/htdocs/drupal/sites/all/modules/uc_webform_pane/uc_webform_pane.module).

arski’s picture

mmh, which Webform version are you running? I have a feeling the new webform release has caused bugs in this module yet again..

bancarddata’s picture

Webform is at 3.17

arski’s picture

Version: 7.x-3.8 » 7.x-3.x-dev

Running 3.17 and not getting the issue, guess it's not Webform's fault. What are your multilingual settings on the site?

bancarddata’s picture

Status: Active » Postponed

I am just running English, no modifications to any multilingual settings. I believe it would be in the best interest of us both if I start rebuilding this site in a new instance and see if a clean install with my necessary set of modules produces the same results. Unless someones else reports similar problems, I don't want to waste your time. Seeing as I am the only one with the problem at the moment, it is likely being caused by something outside of the scope of this module. I appreciate the help and will get back to you in a week or two with an update.

arski’s picture

OK, that sounds good too of course. May be the case that you forgot to run update.php at some point or have some weird setting cached.. Or maybe there is some other module that does something to the safe_value of a field.. hmm

Let me know if you manage to reproduce and/or narrow the issue down to something.

Cheers

arski’s picture

Status: Postponed » Closed (cannot reproduce)
diggingrelic’s picture

I am having the same issue.

I am using:
Drupal 7.14
Ubercart 7.x-3.1
Webform Checkout Pane 7.x-3.8+3-dev
Webfrom 7.x-3.18

I am not using any multi-lingual versions of anything.

I will check a couple things on my end too and see if I can't track down the issue.

arski’s picture

Status: Closed (cannot reproduce) » Active
arski’s picture

Status: Active » Postponed (maintainer needs more info)

still can't reproduce, so..

arski’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

closing for lack of follow up. feel free to reopen with more details.

arski’s picture

marked #1832366: Undefined index as duplicate

markbannister’s picture

follow up from duplicate post https://drupal.org/node/1832366

Drupal core 7.16
Ubercart Webform Checkout Pane 7.x-3.9
Webform 7.x-4.0-alpha6 started at 7.x-3.18 and thought 4 might fix the issue

Created form with a single text field and that worked just fine. No default values, non-mandatory, not unique, 75 chars
Added a selection options field
no default, non-mandatory, (tried list and selection box)
Options:
1|10 AM - 11 AM
2|11 AM - 1 PM
3|1 PM - 5 PM
4|5 PM - 7 PM
Tried changing safe values as well.
Removed selection options field. no help
Deleted form, rebuilt with same name, same results.
Changed form Name - no help

Error: Notice: Undefined index: safe_value in uc_webform_pane_uc_order_pane() (line 364 of /home/sites/store.stthomasbbq.org/public_html/sites/all/modules/uc_webform_pane/uc_webform_pane.module).

arski’s picture

Hmm, still cant reproduce.. the weird thing is that youre getting an error from the order_pane hook (not the checkout pane) during checkout. Maybe its someone else viewing a different page that caused it? Could you locate the error in your admin/reports/dblog and confirm that the error was indeed triggered at checkout.

Are you using any localization modules or anything of the kind?

I'm at Drupal 7.18 and Ubercart 7.x-3.3 now - could you update to those to see if the problem persists.

If only I could reproduce this once..

arski’s picture

Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

Hmm, in the Webform node - do you have any description (body) set? and what format are you using for that? just plain text or something else?

stadulis66’s picture

This issue is not getting fixed, and keeps getting punted to other pages that have no answers. Has anybody been able to solve this error?

stadulis66’s picture

I have found 20 posts related to the same problem. Same thing over and over. Notice: Undefined index: safe_value in uc_webform_pane_uc_checkout_pane() (line 246 of /home/indiemc/public_html/sites/all/modules/uc_webform_pane/uc_webform_pane.module).

Please help.

arski’s picture

its not being punted anywhere (not sure what 20 posts you mean..) please provide details of your setuo so that I could reproduce and fix this..

arski’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

please provide more info about your setup, including possible locale, i18n configuration, languages on your site, etc..

jawi’s picture

same issue here:

Notice: Undefined index: nl in uc_webform_pane_uc_order_pane() (regel 364 van /home/reseller/domains/domain.com/public_html/sites/default/modules/uc_webform_pane/uc_webform_pane.module).

arski’s picture

Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

Please provide some more information regarding the modules you have and the configuration you're using (especially any locale/i18n settings applying to ubercart/webform)

syturvy’s picture

Same here:

Notice: Undefined index: es in uc_webform_pane_uc_checkout_pane() (line 246 of /var/www/vhosts/myweb.com/httpdocs/sites/all/modules/uc_webform_pane/uc_webform_pane.module).

The notice appears on /es/admin/store/settings/checkout

I fixed this by changing line 246

$body = !empty($node->body) ? $node->body[$node->language][0]['safe_value'] : '';

into

$body = !empty($node->body) ? $node->body['und'][0]['safe_value'] : '';

Note that this problem also occurs on line 266 and 364.

My modules (relevant ones only):

  • Drupal 7.18
  • Ubercart 7.x-3.3
  • Ubercart Webform Checkout Pane 7.x-3.9
  • Webform 7.x-3.18
  • Entity tokens 7.x-1.0
  • Entity API 7.x-1.0
  • Views 7.x-3.5
  • Chaos tools 7.x-1.2
markbannister’s picture

Getting this off and on 7.x-3.9. Reappeared after enabling/disabling. Line 366.
Disabled and re-enabled again and it went away again. ... and now it's back

markbannister’s picture

made these changes to lines 248,271, 366
WAS: $body = !empty($node->body) ? $node->body[$node->language][0]['safe_value'] : '';

IS:

$body = !empty($node->body) ? 
       (isset( $node->body[$node->language][0]['safe_value']) ? $node->body[$node->language][0]['safe_value']:$node->body[$node->language][0]['value'])
	   :'';

Is this kosher? I don't know anything about values vs safe_value. Seems like something else is going on.

jerry’s picture

Issue summary: View changes

Minor variation on the solutions already offered:

$body = !empty($node->body) ?
  (isset($node->body[$node->language][0]['safe_value']) ?
    $node->body[$node->language][0]['safe_value'] :
    $node->body[LANGUAGE_NONE][0]['safe_value']) :
  '';
jerry’s picture

Status: Postponed (maintainer needs more info) » Active
Anonymous’s picture

#27 #26 worked for me

$body = !empty($node->body) ?
(isset($node->body[$node->language][0]['safe_value']) ?
$node->body[$node->language][0]['safe_value'] :
$node->body[$node->language][0]['value']):
'';

Rafal Lukawiecki’s picture

For those who are still affected by this issue, I attach a patch, which in essence is the contents of #29 applied in the 3 relevant places mentioned in #26. This patch should be applied to the dev branch of the module. It works on our site.

Anonymous’s picture

Using patch #30 and I stil have:
Notice: Undefined index: und in uc_webform_pane_uc_order_pane() (line 375 ........../drupal-7/sites/all/modules/uc_webform_pane/uc_webform_pane.module).

To remove this notice I changed the lines with $node->body[LANGUAGE_NONE][0]['value']): to $node->body[$node->language][0]['value']):

Rafal Lukawiecki’s picture

Status: Active » Needs review

@cmseasy, thank you for the updated patch in #31, your change makes sense to me. I will re-test it on our site, and mark as such here if it worked for us. I assume you had it successfully in production.

Rafal Lukawiecki’s picture

Status: Needs review » Reviewed & tested by the community

I have tested it, and patch in #31 works. I respectfully recommend committing it to the module.