Call to undefined function Drupal\webform_civicrm\civicrm_api3() in Drupal\webform_civicrm\Utils->wf_civicrm_api()

Created on 20 April 2023, over 1 year ago
Updated 23 April 2023, over 1 year ago

1.0 Problem/Motivation

In some cases viewing results of a CiviCRM webform leads to this error due to CiviCRM not being initialized yet.

2.0 Detailed steps to reproduce (embed screenshots)

Create a Webform with CivICRM processing enabled, submit it and try to view results. I'm not sure about the specific scenario and don't have the time to investigate as the Webform this appears on is quite large.

3.0 Proposed resolution

In \_fillCiviCRMData() there should be a \Drupal::service('civicrm')->initialize();, which makes sure we have our global functions available. Re-initializing does not hurt as it early-returns in that case.

See Pull Request in the GitHub repo.

🐛 Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

🇩🇪Germany jensschuppe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024