Steps to reproduce

On the CiviCRM 4.7 / Drupal 7 demo site (demo.civihosting.com):

  1. Go to "Administer -> System Settings -> Mapping and Geocoding"
  2. Set "Mapping Provider" and "Geocoding Provider" to "Google"
  3. Go to "Create New -> Individual"
  4. Set "First Name" and "Last Name" to "Test"
  5. Open "Address"
  6. Set "Country" to "Italy"
  7. Click "Save"

Expected behavior

A new contact should be created, and I should see the summary page for it.

Actual behavior

I see an error page, reading:

Sorry but we are not able to provide this at the moment.
Return to home page.

Fatal error: Uncaught CRM_Core_Exception: [0: Transaction integrity error: Expected to find active frame thrown in /home/galleryr/www/demo/sites/all/modules/civicrm/Civi/Core/Transaction/Manager.php on line 107


After reading the logs in ConfigAndLog, I found the problem had to do with the empty state/province field. I tracked it down to lines 1060 to 1068 ofCRM/Core/DAO.php:

1060 if ( 1061 empty($searchValue) || 1062 trim(strtolower($searchValue)) == 'null' 1063 ) { 1064 // adding this year since developers forget to check for an id 1065 // or for the 'null' (which is a bad DAO kludge) 1066 // and hence we get the first value in the db 1067 CRM_Core_Error::fatal(); 1068 }

Simply deleting these lines seems to resolve the issue. From the comment about "we get the first value in the db", I expected the newly created contact to have an address with state/province id 1, but actually it worked as it should: I gave no state/province, and no state/province is what came out.

Hope that helps. Cheers!


Similar to the above seems to be fixed recently. Can you please try https://github.com/civicrm/civicrm-core/pull/10192 and check if that fixes for you?

Note: The PR is merged in 4.7.20, so it should work without error on this version.

  • Yes, that fixes it for me. Thanks @jitendrapurohit! – Spencer Campbell May 10 '17 at 9:12

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.