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.
I get this error when i try to add a new validation rule for is empty...
Error: Call to undefined function webform_component_list() in webform_validation_get_webform_components()
Comment | File | Size | Author |
---|---|---|---|
#4 | webform_validation-undefined-function-2847302-4.patch | 603 bytes | kiseleva.t |
Comments
Comment #2
Liam MorlandI am not seeing this. Please try the latest development version. If that does not fix it, please provide steps to reproduce.
Comment #3
Liam Morland"needs work" is for issues that have a patch.
Comment #4
kiseleva.t CreditAttribution: kiseleva.t as a volunteer and at DrupalJedi commentedThis patch solves problem for me.
Comment #5
Liam MorlandCan you provide steps to reproduce the problem? I don't see it.
Comment #6
kiseleva.t CreditAttribution: kiseleva.t as a volunteer and at DrupalJedi commentedThis error appears when I try to add any validation rule.
For example: node/NID/webform/validation/add/someofseveral
Comment #7
Liam MorlandI don't understand how this could happen. Webform should already be loaded. Do you have any other Webform-related modules installed? Does it fix it to use module_load_include() instead of form_load_include()?
Does anyone else have this problem?
Comment #8
m.lebedev CreditAttribution: m.lebedev commentedI have the same error!
Comment #9
jh3 CreditAttribution: jh3 as a volunteer commentedSame problem. Using webform 7.x-4.7.
Webform and webform validation are the only two webform related modules I have installed.
I have not fully debugged this issue, but webform_component_list() is in webform.components.inc. The .inc file is loaded only in certain cases within the webform module. My assumption is that the menu path for adding a validation rule (e.g. node/%nid/webform/validation/add/regex) is not one of these cases. This is why webform.components.inc needs to be explicitly loaded before calling webform_component_list().
form_load_include() works in this case because webform_validation_get_webform_components() is called from a form.
See https://api.drupal.org/api/drupal/includes%21form.inc/function/form_load...
webform_validation_get_webform_components() is also in a .inc file.
The patch from #4 works, but $form_state should probably be passed to webform_validation_get_webform_components() so that it can then be passed into the form_load_include() call.
Comment #10
conniemh CreditAttribution: conniemh commentedWe see the same error when trying to edit or add a webform validation for a field. The patch from #4 allows us to edit or create new field validations. I do not code, so thanks to you all for working on permanent fixes. This is our platform in case it helps:
Webform 7.x-4.14
Webform Validation 7.x-1.13
Drupal 7.53
php 5.5.9
mysql Ver. 14.14 Distrib 5.5.52
Comment #11
seyfcom CreditAttribution: seyfcom commentedI have the same error...
webform_validation-undefined-function-2847302-4.patch
helped me! fixed!
Comment #13
Liam MorlandComment #15
Gonzalo2683 CreditAttribution: Gonzalo2683 commentedI have the same problem, the #4 entry solve my problem.