Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | webform_conditional_mandatory_field.patch | 641 bytes | gugalamaciek |
Comments
Comment #2
gugalamaciek CreditAttribution: gugalamaciek commentedTry 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).
Comment #3
stevendeleus CreditAttribution: stevendeleus commentedI can confirm the patch works.
Comment #4
RyanPrice CreditAttribution: RyanPrice as a volunteer commentedComment #6
RyanPrice CreditAttribution: RyanPrice as a volunteer commentedMerged into the latest release, 7.x-1.0
Comment #7
jay.dansand CreditAttribution: jay.dansand commentedThis 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!
Comment #8
RyanPrice CreditAttribution: RyanPrice as a volunteer commentedGood catch jay - my mistake for committing that. I have reverted and released a new version.
Comment #9
jay.dansand CreditAttribution: jay.dansand commentedHooray! 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!
Comment #10
jay.dansand CreditAttribution: jay.dansand commentedOops - I just downloaded 7.x-1.1 and it's still referring to "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).
Comment #11
RyanPrice CreditAttribution: RyanPrice as a volunteer commentedBah, 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
Comment #12
akarmalkar CreditAttribution: akarmalkar as a volunteer and commentedPlease add the patch and release new version.
Patch Link: https://www.drupal.org/files/issues/webform_conditional_mandatory_field....