Hi all,

On the latest alpha6 of webform 7.x-4.0, I am getting the following error:

PHP Fatal error: Call to undefined function webform_component_property() in drupal/sites/all/modules/webform/webform.module on line 2333

This occurs when I click the "View" button from /node/%/webform-results, i.e. /node/%/submission/%. I can get to the /node/%/submission/%/edit page ok, but the "Re-send Emails" button also produce the same error noted above.

The form in question is a simple form with a text field for name, a select list for "how do you want to be contacted" with options for phone or email, an email field, a phone field, and a text area. I then have conditions in place to hide the email field if "how do you want to be contacted" is set to phone, and to hide phone if it is set to email.

In order to troubleshoot, I built a test form just like the form above, one field at a time. The view button always worked for each field as I added them and made a test submission. However, as soon as I added the conditions, I could no longer click the view button without that error occuring. I then went back and removed the conditions, and the view button worked fine again. Since the phone field is being supplied by the "webform_phone" module, I decided I'd just make all of the fields simple text fields (except for the select field) to try to eliminate that as the cause. It didn't seem to matter - as long as I had put those conditions on the form, I could no longer view the submission. As soon as I take the conditions back off, the view button worked fine.

Any ideas?

Members fund testing for the Drupal project. Drupal Association Learn more


quicksketch’s picture

Category: support » bug
Status: Active » Needs review
450 bytes

Hi there, thanks for the report! I think this is a bug in Webform. Oddly I don't get the same error when viewing submissions myself, but I can see how this would happen. We're not including the webform.components.inc file before rendering, so in some situations a "function not found" error may occur, like you're experiencing. This patch should fix the issue, could you try it out and see if it works for you?

bancarddata’s picture

Status: Needs review » Reviewed & tested by the community

and thank you for the quick and excellent support - Patch worked great!

jlea9378’s picture

I was also experiencing this bug, and the patch appears to have worked perfectly in resolving it.

bjcooper’s picture

Priority: Normal » Minor
Status: Reviewed & tested by the community » Fixed

Also mentioning that I had the same error and that the patch was effective. I got the error out of the blue for some reason, after using webform without problems for several months. All better now.

bjcooper’s picture

Category: bug » support
Priority: Minor » Normal
Status: Fixed » Reviewed & tested by the community

Woops, didn't mean to change the issue status. Setting it back.

SpenserJ’s picture

Another confirmation that this patch solves the problem. @quicksketch, is there anything else that needs to be done before this is committed?

quicksketch’s picture

Category: support » bug
Status: Reviewed & tested by the community » Fixed

I've just been busy with a lot of other projects, sorry for the delay. Committed patch in #1 to the 7.x-4.x branch.

Status: Fixed » Closed (fixed)

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