compucorp / webform_civicrm_postcode

0 stars 2 forks source link

Undefined function error #5

Closed michael-chaplin-gmcvo closed 5 years ago

michael-chaplin-gmcvo commented 5 years ago

When trying to change a textfield in a webform to a postcode widget, it fails with an error:

Error: Call to undefined function wf_crm_tokeninput_path() in _webform_edit_civipostcode() (line 8 of /home/XXXXXX/public_html/sites/all/modules/webform_civicrm_postcode/includes/civipostcode_component.inc).

Have updated webform + webform_civicrm to latest. PHP = 7.1.

michael-chaplin-gmcvo commented 5 years ago

Fixed the above bug:

/public_html/sites/all/modules/webform_civicrm_postcode/includes/civipostcode_component.inc

function _webform_edit_civipostcode($component) { //dsm(module_exists('webform_civicrm'));//returns 1 // new line follows, allows this module to find function wf_crm_tokeninput_path module_load_include('inc', 'webform_civicrm', 'includes/contact_component');

$form = array(); $form['#attached']['js'][] = wf_crm_tokeninput_path(); return $form; }

Shubham-Compucorp commented 5 years ago

@mikantchap the issue has now been fixed and merged to master.