Answers.Body: <p>This got solved on our site on CiviCRM 5.3.1 and Joomla 3.8.10 by creating and entering a Google Geocoding API key</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-26T23:52:31.903Z
Answers.LastActivityDate: 2018-07-26T23:52:31.903Z
Answers.UserDisplayName: MtnPavlas
Body: <p>When selecting a different location for an event where this event is the only one using the current location, upon save you'll see an endless spinner.</p>
  
  <p>Everything seems to get deleted just fine in the d/b (the previous location gets deleted as it's no longer needed as it was only used by one event ... that's how Civi does it, anyway), but the endless spinner in the UI is annoying and our staff get worried. ('coz, you know, we saw the recent bug where creating a new location inserted this location to all events that shared the previous location ... anyway, our staff are a little gun shy as you can imagine).</p>
  
  <p>In the error log, I see the following:</p>
  
  <pre><code>[code] =&gt; -3
  [message] =&gt; DB Error: constraint violation
  [mode] =&gt; 16
  [debug_info] =&gt; UPDATE  civicrm_loc_block  SET address_id = 29774 , email_id = NULL , phone_id = NULL , im_id = NULL , address_2_id = NULL , email_2_id = NULL , phone_2_id = NULL , im_2_id = NULL   WHERE (  civicrm_loc_block.id = 61 )   [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`evergr55_test`.`civicrm_loc_block`, CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
  [type] =&gt; DB_Error
  [user_info] =&gt; UPDATE  civicrm_loc_block  SET address_id = 29774 , email_id = NULL , phone_id = NULL , im_id = NULL , address_2_id = NULL , email_2_id = NULL , phone_2_id = NULL , im_2_id = NULL   WHERE (  civicrm_loc_block.id = 61 )   [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`evergr55_test`.`civicrm_loc_block`, CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
  [to_string] =&gt; [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE  civicrm_loc_block  SET address_id = 29774 , email_id = NULL , phone_id = NULL , im_id = NULL , address_2_id = NULL , email_2_id = NULL , phone_2_id = NULL , im_2_id = NULL   WHERE (  civicrm_loc_block.id = 61 )   [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`evergr55_test`.`civicrm_loc_block`, CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]"]
  </code></pre>
  
  <p>I was able to reproduce this on one of the demo sites (which uses Drupal; I'm seeing it on Joomla on my end).</p>
  
  <p>Anyone else seen this issue? Wanted to check here before submitting an issue on Github.</p>
  
  <p>Thx</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-13T21:36:21.530Z
Comments.Text: What error are you seeing in console? Also check network tab, it should be failing on getting some resource.
Comments.UserDisplayName: Hassan Farooq
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-07-26T23:51:49.320Z
Comments.Text: Nothing in the console or network tabs in Chrome. The screen just freezes with the Civi triangle spinner overlay. Was able to repro this on a demo site w/ CiviCRM 5.3.1; however, I think I figured out the root cause as I fixed it on our site - I'll post it as an answer
Comments.UserDisplayName: MtnPavlas
Tags: <civievent><location>
Title: endless spinner when selecting event location
ThreadText: # endless spinner when selecting event location
  
  (Asked by: username_0 on 2018-06-05)
  
  When selecting a different location for an event where this event is the only one using the current location, upon save you'll see an endless spinner.
  
  Everything seems to get deleted just fine in the d/b (the previous location gets deleted as it's no longer needed as it was only used by one event ... that's how Civi does it, anyway), but the endless spinner in the UI is annoying and our staff get worried. ('coz, you know, we saw the recent bug where creating a new location inserted this location to all events that shared the previous location ... anyway, our staff are a little gun shy as you can imagine).
  
  In the error log, I see the following:
  
  ```
  [code] => -3
  [message] => DB Error: constraint violation
  [mode] => 16
  [debug_info] => UPDATE  civicrm_loc_block  SET address_id = 29774 , email_id = NULL , phone_id = NULL , im_id = NULL , address_2_id = NULL , email_2_id = NULL , phone_2_id = NULL , im_2_id = NULL   WHERE (  civicrm_loc_block.id = 61 )   [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`evergr55_test`.`civicrm_loc_block`, CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
  [type] => DB_Error
  [user_info] => UPDATE  civicrm_loc_block  SET address_id = 29774 , email_id = NULL , phone_id = NULL , im_id = NULL , address_2_id = NULL , email_2_id = NULL , phone_2_id = NULL , im_2_id = NULL   WHERE (  civicrm_loc_block.id = 61 )   [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`evergr55_test`.`civicrm_loc_block`, CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
  [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE  civicrm_loc_block  SET address_id = 29774 , email_id = NULL , phone_id = NULL , im_id = NULL , address_2_id = NULL , email_2_id = NULL , phone_2_id = NULL , im_2_id = NULL   WHERE (  civicrm_loc_block.id = 61 )   [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`evergr55_test`.`civicrm_loc_block`, CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]"]
  
  ```
  
  I was able to reproduce this on one of the demo sites (which uses Drupal; I'm seeing it on Joomla on my end).
  
  Anyone else seen this issue? Wanted to check here before submitting an issue on Github.
  
  Thx
  
  **Tags:** civievent, location
  
  > **Comments:**
  > **username_1**: What error are you seeing in console? Also check network tab, it should be failing on getting some resource.  
  > **username_0**: Nothing in the console or network tabs in Chrome. The screen just freezes with the Civi triangle spinner overlay. Was able to repro this on a demo site w/ CiviCRM 5.3.1; however, I think I figured out the root cause as I fixed it on our site - I'll post it as an answer  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-07-26. Score: 2 | Accepted answer
  
  This got solved on our site on CiviCRM 5.3.1 and Joomla 3.8.10 by creating and entering a Google Geocoding API key
  
  
  ---
  
  