1

Since upgrading to Civi 4.7.28, webform submissions via the Drupal 7 module "Webform CiviCRM" have not been able to create a new address in a new CiviCRM contact. In the error log, I have these errors:

The CiviCRM "address create" API returned the error: "A fatal error was triggered" when called by function "preSave" on line 178 of wf_crm_webform_postprocess.inc with parameters:...

Are others having the same problem? I'm not clear whether it's a fault with the Drupal module or the Civi API. I can't recreate in the CiviCRM sandbox as I don't think that has the Webform module operational.

UPDATED FOLLOWING COMMENT.
Here is the backtrace:

 $backTrace = 
0:/htdocs/sites/all/modules/civicrm/CRM/Core/Error.php(336): CRM_Core_Error::backtrace("backTrace", TRUE) 
1:/htdocs/sites/all/modules/civicrm/CRM/Core/DAO.php(1101): CRM_Core_Error::fatal()
2:/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/Address.php(1008): CRM_Core_DAO::getFieldValue("CRM_Core_DAO_Address", "null", "master_id") 
3:/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/Address.php(157): CRM_Core_BAO_Address::fixSharedAddress((Array:16)) 
4:/htdocs/sites/all/modules/civicrm/api/v3/Address.php(83): CRM_Core_BAO_Address::add((Array:16), TRUE)
5:/htdocs/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_address_create((Array:16)) 
6:/htdocs/sites/all/modules/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9)) 
7:/htdocs/sites/all/modules/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel->runRequest((Array:9)) 
8:/htdocs/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("address", "create", (Array:15), NULL) 
9:/htdocs/sites/all/modules/webform_civicrm/includes/utils.inc(1534): civicrm_api("address", "create", (Array:15)) 
10:/htdocs/sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc(819): wf_civicrm_api("address", "create", (Array:15)) 
11:/htdocs/sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc(178): wf_crm_webform_postprocess->saveContactLocation((Array:14), "1276", 1) 
12:/htdocs/sites/all/modules/webform_civicrm/webform_civicrm.module(222): wf_crm_webform_postprocess->preSave(Object(stdClass)) 
13:/htdocs/sites/all/modules/webform/includes/webform.submissions.inc(151): webform_civicrm_webform_submission_presave(Object(stdClass), Object(stdClass)) 
14:/htdocs/sites/all/modules/webform/webform.module(3394): webform_submission_insert(Object(stdClass), Object(stdClass))
15:/htdocs/includes/form.inc(1520): webform_client_form_submit((Array:34), (Array:26)) 
16:/htdocs/includes/form.inc(904): form_execute_handlers("submit", (Array:34), (Array:26)) 
17:/htdocs/includes/form.inc(386): drupal_process_form("webform_client_form_1688", (Array:34), (Array:26)) 
18:/htdocs/includes/form.inc(131): drupal_build_form("webform_client_form_1688", (Array:26)) 
19:/htdocs/sites/all/modules/webform/webform.module(2061): drupal_get_form("webform_client_form_1688", Object(stdClass), FALSE, FALSE) 
20:/htdocs/sites/all/modules/webform/webform.module(2330): webform_node_view(Object(stdClass), "form") 
21:/htdocs/includes/module.inc(926): webform_block_view("client-block-1688") 
22:/htdocs/modules/block/block.module(911): module_invoke("webform", "block_view", "client-block-1688") 
23:/htdocs/modules/block/block.module(690): _block_render_blocks((Array:2)) 
24:/htdocs/modules/block/block.module(319): block_list("content") 
25:/htdocs/modules/block/block.module(270): block_get_blocks_by_region("content") 
26:/htdocs/includes/common.inc(5901): block_page_build((Array:4)) 
27:/htdocs/includes/common.inc(2748): drupal_render_page((Array:4)) 
28:/htdocs/includes/common.inc(2621): drupal_deliver_html_page((Array:1)) 
29:/htdocs/includes/menu.inc(542): drupal_deliver_page((Array:1), "")  
30:/htdocs/index.php(21): menu_execute_active_handler() 
31 {main}

There was also a geocoding error logged at the same time, but I don't know why this happened, as we only add a few addresses each day, and I don't see that this should trigger a fatal error:

$Geocoding failed. Message from Google: (OVER_QUERY_LIMIT) = You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_

  • Could you please post a debug and backtrace to help folks answer you? Note that you'll probably need to use the "CiviCRM log" method because you're triggering this error from Drupal, not Civi itself. – Jon G - Megaphone Tech Dec 21 '17 at 18:25
  • Thanks Jon. I've added the backtrace in the original question above and also noticed that a geocoding error was logged at the same time. – Stuart Parker Dec 22 '17 at 9:08
  • Thanks! That illuminates things. I see the code that's causing the crash. It's meant to prevent misuse of the "address sharing" feature. However, it seems like this situation should specifically not trigger that code. As a next troubleshooting step please: * open <civiroot>/CRM/Core/BAO/Address.php * Find this line (around 137): public static function add(&$params, $fixAddress = FALSE) { * Insert the following line just below it: CRM_Core_Error::debug_var('myparams', $params); * Retrigger this bug and search your CiviCRM log for "myparams". Update the question with the result? – Jon G - Megaphone Tech Dec 22 '17 at 23:03
3

To solve this issue, you should apply this patch to your CiviCRM code (which wasn't merged in time for 4.7.29).

You'll find more information on this issue on this pull request and on this issue: CRM-21214 .

Cheers, Olivier;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.