Problem/Motivation

Call to undefined function webform_component_parent_keys()

Seeing this infrequently in my error log.

Proposed resolution

Add the include to the info file so it gets loaded by the auto loader.

Remaining tasks

User interface changes

API changes

CommentFileSizeAuthor
#2 call_to_undefined-2506403-2.patch768 bytesjoelpittet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet’s picture

The stack trace is showing it originates from 1112 of webform.conditionals.inc

joelpittet’s picture

Version: 7.x-4.9 » 7.x-4.x-dev
Status: Active » Needs review
FileSize
768 bytes

This may be a bit better solution, see patch.

DanChadwick’s picture

Category: Bug report » Support request
Status: Needs review » Postponed (maintainer needs more info)

Here's what happens:

  1. When webform_client_form generates the form, it sets the theme to webform_form.
  2. That causes template_preprocess_webform_form to be called.
  3. That function calls webform_conditional_prepare_javascript.
  4. That function calls webform_component_parent_keys.

But webform_client_form also uses form_load_include to include webform.components.inc, so the patch in #2 should not be necessary.

I'm guessing that something happened to the form by way of a form_alter or perhaps theme that is causing the form_load_include to not load, or perhaps some ajax / jQuery request. You will need to debug to see how this is possible.

While it is possible that webform has a bug here, I'd say it is extremely unlikely. A call to an undefined function is fatal and people would be seeing errors and we'd have lots of reports. Something is different about your installation.

If you verify that this can happen on a clean installation, please change the status back to Bug and re-open as Active. Thanks.

joelpittet’s picture

In my case it could be authcache or js module that may be altering things in a funky way... my eye is on authcache. *squints*

DanChadwick’s picture

A stack trace would give some clues, maybe. If no one is complaining, maybe its an ajax error where you wouldn't see the failure??

joelpittet’s picture

It's the only error showing up in my watchdog at the moment so I'm trying to knock it out.

Here's the callstack from new relic:

in WebformConditionals::webform_conditional_prepare_javascript called at /sites/all/modules/contrib/webform/includes/webform.conditionals.inc (1112)
in webform_conditional_prepare_javascript called at /sites/all/modules/contrib/webform/webform.module (3417)
in template_preprocess_webform_form called at /includes/theme.inc (1125)
in theme called at /includes/common.inc (5987)
in drupal_render called at /sites/all/modules/contrib/webform/webform.module (2046)
in theme_webform_view called at /includes/theme.inc (1161)
in theme called at /includes/common.inc (5987)
in drupal_render called at /includes/common.inc (5994)
in drupal_render called at /includes/common.inc (6088)
…lled at /sites/all/themes/em/templates/node/
node.tpl.php (103)
in include called at /includes/theme.inc (1546)
in theme_render_template called at /includes/theme.inc (1208)
in theme called at /includes/common.inc (5987)
in drupal_render called at /includes/common.inc (6088)
…var/sites/all/themes/em/templates/panels/
panels-pane.tpl.php (41)
in include called at /includes/theme.inc (1546)
in theme_render_template called at /includes/theme.inc (1208)
…es/contrib/panels/plugins/display_renderers/
panels_renderer_standard.class.php (532)
…es/contrib/panels/plugins/display_renderers/
panels_renderer_standard.class.php (482)
…es/contrib/panels/plugins/display_renderers/
panels_renderer_standard.class.php (389)

And another maybe unrelated webform error:

E_ERROR: Call to a member function preview() on a non-object

in webform_admin_content called at /sites/all/modules/contrib/webform/includes/webform.admin.inc (307)
in webform_admin_content called at ? (?)
in call_user_func_array called at /includes/menu.inc (519)
in menu_execute_active_handler called at /index.php (21)
DanChadwick’s picture

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

Closing for lack of activity.

joelpittet’s picture

FYI, still using my patch... keeps the errors away...

Leiph’s picture

I am getting this error as well, but during use of Rules.

i have a webform node and need to use it's title within a Rule.
* If I invoke the data through 'Data selection' everything works as expected.
* If invoke the data though 'Direct input mode' and use the token [webform:title] the error occurs.

In comment #3 Dan says "But webform_client_form also uses form_load_include to include webform.components.inc, so the patch in #2 should not be necessary."

My error message says
Fatal error: Call to undefined function webform_component_parent_keys() in ...drupal/sites/all/modules/webform_charts/webform_charts.tokens.inc on line 41

I assume that this call do not invoke form_load__include thus the webform_component_parent_keys is never defined.