Steps to reproduce
On the CiviCRM 4.7 / Drupal 7 demo site (demo.civihosting.com):
- Go to "Administer -> System Settings -> Mapping and Geocoding"
- Set "Mapping Provider" and "Geocoding Provider" to "Google"
- Go to "Create New -> Individual"
- Set "First Name" and "Last Name" to "Test"
- Open "Address"
- Set "Country" to "Italy"
- 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
Analysis
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!