After update of module Webform to version 7.x-4.11 this notice occurs:

Notice: Undefined index: mandatory in webform_conditional_form_alter()

It coused by the fact that schema webform_component have been updated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vtkachenko created an issue. See original summary.

gugalamaciek’s picture

Try this patch. It's probably because parameter name have been changed from mandatory to required (in $row there is no mandatory element, but there is required element).

stevendeleus’s picture

I can confirm the patch works.

RyanPrice’s picture

Priority: Major » Normal
Status: Active » Reviewed & tested by the community

  • RyanPrice committed 4c754a2 on 7.x-1.x authored by ngwebs
    Issue #2581147 by ngwebs: Notice: Undefined index: mandatory in...
RyanPrice’s picture

Version: 7.x-1.0-beta2 » 7.x-1.0
Status: Reviewed & tested by the community » Closed (fixed)

Merged into the latest release, 7.x-1.0

jay.dansand’s picture

Priority: Normal » Major
Status: Closed (fixed) » Needs work
Related issues: +#2359049: webform_conditional notices.

This change breaks Webform Conditional for Webform 3.x users, which are the only legitimate users. See #2359049: webform_conditional notices..

TL;DR: Webform Conditional should retain the old Webform 3.x-style "mandatory" field name, because the only valid users of Webform Conditional are still on Webform 3.x, not Webform 4.x.

According to Webform's upgrade documentation, Webform Conditional must be uninstalled for Webform 4.x, which means any user encountering "Notice: Undefined index: mandatory" has incorrectly upgraded Webform, and needs to disable Webform Conditional.

Please revert and roll a new release. Thanks!

RyanPrice’s picture

Status: Needs work » Closed (fixed)

Good catch jay - my mistake for committing that. I have reverted and released a new version.

jay.dansand’s picture

Hooray! Thanks, and especially for the speedy turnaround!

Also, and because it can never be said enough, thanks for supporting such a useful module. It really is appreciated!

jay.dansand’s picture

Version: 7.x-1.0 » 7.x-1.1
Status: Closed (fixed) » Needs work

Oops - I just downloaded 7.x-1.1 and it's still referring to "required":

if ($row['required']) {

Looks like something went wrong with the revert (the commit from today, fc1507e, makes the same change from the same parent as the previous [and erroneous] commit 4c754a2).

RyanPrice’s picture

Status: Needs work » Closed (fixed)

Bah, looks like I made the change and then merged the old one back in instead of the other way around. Fixed now. Rerolling shortly.

Ryan

akarmalkar’s picture

Please add the patch and release new version.
Patch Link: https://www.drupal.org/files/issues/webform_conditional_mandatory_field....