I have the message "Call to undefined function webform_component_list()" on the page "node/18263/webform/emails" and a similar message sending the form.
I installed webform and webform_conditional modules.

The module invoke a function of "ncludes/webform.components" file, but the file is not included.
My solution is quick and dirty, I included the file.
I hope someone finds a better solution: D

Thanks

Index: webform.module
===================================================================
--- webform.module      (revision 811)
+++ webform.module      (working copy)
@@ -12,6 +12,10 @@
  * @author Pontus Ullgren <ullgren@user.sourceforge.net>
  */

+# PB:2010/07/26 incluso il file .inc che contiene la funzione webform_component_list richiamata in questa funzione
+module_load_include('inc', 'webform', 'includes/webform.components');
+# PB:2010/07/26 FINE
+
 /**
  * Implementation of hook_help().
  */

Index: includes/webform.emails.inc
===================================================================
--- includes/webform.emails.inc (revision 811)
+++ includes/webform.emails.inc (working copy)
@@ -8,14 +8,14 @@
  * @author Nathan Haug <nate@lullabot.com>
  */

+# PB:2010/07/26 incluso il file .inc che contiene la funzione webform_component_list richiamata in questa funzione
+module_load_include('inc', 'webform', 'includes/webform.components');
+# PB:2010/07/26 FINE
+

Comments

quicksketch’s picture

Status: Active » Needs review
StatusFileSize
new1.85 KB

Thanks, including the file as necessary is the right approach, but you probably shouldn't just be pulling in the webform.components.inc file at the top of those files, especially since using module_load_include() at the top of a file like that will break install profiles. This patch will just include the file as needed within individual functions.

quicksketch’s picture

Status: Needs review » Fixed

I've committed the patch in #1. Please reopen if the problem still exists.

Anonymous’s picture

Status: Fixed » Needs review

Sorry but the problem is still present when I submit the form.
I need olso this include

Index: webform.module
===================================================================
--- webform.module      (revision 829)
+++ webform.module      (working copy)
@@ -2291,6 +2291,8 @@
  *   non-cached situations, such as e-mails.
  */
 function _webform_filter_values($string, $node = NULL, $submission = NULL, $email = NULL, $strict = TRUE, $allow_anonymous = FALSE) {
+  module_load_include('inc', 'webform', 'includes/webform.components');
+
   global $user;
   static $replacements;
quicksketch’s picture

StatusFileSize
new643 bytes

Does this patch work equally as well? I think the only function we need is webform_component_parent_keys() here, so there's no need to pull in the file on every call to the filter function.

Anonymous’s picture

I tried the solution #4, but the message I get is still:

Fatal error: Call to undefined function webform_component_parent_keys() in /mnt/www-asp-s2/web146/web/sites/no-visible/modules/webform/webform.module on line 2324

It's strange but this is the result

quicksketch’s picture

Status: Needs review » Fixed
StatusFileSize
new1002 bytes

I've committed this patch which should guarantee that the file is pulled in when viewing any Webform form. If you're getting the problem still and running PHP 5.3 you might check your PHP configuration (see #807680: APC setting "apc.include_once_override" causes call to undefined function filefield_widget_settings_save()).

Status: Fixed » Closed (fixed)

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

sorinb’s picture

in webform.pages.inc
- add module_load_include as bellow:

function webform_configure_form($form, &$form_state, $node) {
module_load_include('inc', 'webform', 'includes/webform.components');

Thanks,
S.