Answers.Body: <p>Similar to the above seems to be fixed recently. Can you please try <a href="https://github.com/civicrm/civicrm-core/pull/10192" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/10192</a> and check if that fixes for you?</p>
  
  <p>Note: The PR is merged in 4.7.20, so it should work without error on this version.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-10T09:12:34.990Z
Answers.Text: Yes, that fixes it for me. Thanks @jitendrapurohit!
Answers.UserDisplayName: Spencer Campbell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-04T14:00:20.577Z
Answers.LastActivityDate: 2017-05-04T14:00:20.577Z
Answers.UserDisplayName: jitendra - fuzion
Body: <h1>Steps to reproduce</h1>
  
  <p>On the CiviCRM 4.7 / Drupal 7 demo site (demo.civihosting.com):</p>
  
  <ol>
  <li>Go to "Administer -> System Settings -> Mapping and Geocoding"</li>
  <li>Set "Mapping Provider" and "Geocoding Provider" to "Google"</li>
  <li>Go to "Create New -> Individual"</li>
  <li>Set "First Name" and "Last Name" to "Test"</li>
  <li>Open "Address"</li>
  <li>Set "Country" to "Italy"</li>
  <li>Click "Save"</li>
  </ol>
  
  <h1>Expected behavior</h1>
  
  <p>A new contact should be created, and I should see the summary page for it.</p>
  
  <h1>Actual behavior</h1>
  
  <p>I see an error page, reading:</p>
  
  <pre><code>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
  </code></pre>
  
  <h1>Analysis</h1>
  
  <p>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 of<code>CRM/Core/DAO.php</code>:</p>
  
  <p><code>
  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     }
  </code></p>
  
  <p>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.</p>
  
  <p>Hope that helps. Cheers!</p>
  
Tags: <error><4.7><geocoding>
Title: Can't add addresses when geocoding is enabled
ThreadText: # Can't add addresses when geocoding is enabled
  
  (Asked by: username_0 on 2017-05-04)
  
  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!
  
  **Tags:** error, 4.7, geocoding
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-05-04. Score: 1 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_0**: Yes, that fixes it for me. Thanks @jitendrapurohit!  
  
  ---
  
  