localgovdrupal / localgov_events

Events for LocalGov Drupal.
GNU General Public License v2.0
1 stars 0 forks source link

Installation via configuration import #15

Open ekes opened 3 years ago

ekes commented 3 years ago

Just imported exported configuration with events enabled into a site where it hadn't been yet.

The localgov_events_optional_fields_settings requires entity_form_display and entity_view_display of node.localgov_event.default but it seems these hadn't been set yet.

(Assumed) Steps to reproduce (to be tested):

As the imported configuration includes the appropriate conditional fields would it just be fine to test if the appropriate node.localgov_event.default' config is already there and return doing nothing if not?

andybroomfield commented 3 years ago

Not seeing this when testings. But I do get the following

[error]  Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2' for key 'PRIMARY': INSERT INTO {taxonomy_term_data} (tid, revision_id, vid, uuid, langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array
(
    [:db_insert_placeholder_0] => 2
    [:db_insert_placeholder_1] => 2
    [:db_insert_placeholder_2] => localgov_topic
    [:db_insert_placeholder_3] => df8a65ea-700c-4820-b12b-c81ccac0dd6c
    [:db_insert_placeholder_4] => en
)
 in Drupal\Core\Database\Connection->handleQueryException() (line 698 of /app/web/core/lib/Drupal/Core/Database/Connection.php). 

In SqlContentEntityStorage.php line 846:

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2' for key 'PRIMARY': INSERT INTO {taxonomy_term_data} (tid, revision_id, vid, uuid, langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2,  
   :db_insert_placeholder_3, :db_insert_placeholder_4); Array                                                                                                                                                                                                  
  (                                                                                                                                                                                                                                                            
      [:db_insert_placeholder_0] => 2                                                                                                                                                                                                                          
      [:db_insert_placeholder_1] => 2                                                                                                                                                                                                                          
      [:db_insert_placeholder_2] => localgov_topic                                                                                                                                                                                                             
      [:db_insert_placeholder_3] => df8a65ea-700c-4820-b12b-c81ccac0dd6c                                                                                                                                                                                       
      [:db_insert_placeholder_4] => en                                                                                                                                                                                                                         
  )                                                                                                                                                                                                                                                            

In Connection.php line 698:

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2' for key 'PRIMARY': INSERT INTO {taxonomy_term_data} (tid, revision_id, vid, uuid, langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2,  
   :db_insert_placeholder_3, :db_insert_placeholder_4); Array                                                                                                                                                                                                  
  (                                                                                                                                                                                                                                                            
      [:db_insert_placeholder_0] => 2                                                                                                                                                                                                                          
      [:db_insert_placeholder_1] => 2                                                                                                                                                                                                                          
      [:db_insert_placeholder_2] => localgov_topic                                                                                                                                                                                                             
      [:db_insert_placeholder_3] => df8a65ea-700c-4820-b12b-c81ccac0dd6c                                                                                                                                                                                       
      [:db_insert_placeholder_4] => en                                                                                                                                                                                                                         
  )                                                                                                                                                                                                                                                            

In Statement.php line 59:

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2' for key 'PRIMARY'  
andybroomfield commented 3 years ago

And doing a second attempt on a fresh localgov install gives the following

  Table 'search_api_item' already exists.                                      
andybroomfield commented 3 years ago

Cancel above, as that is not clearing the table and search_api tables where still present in DB.

@ekes I did a test on the master branch with the above instructions

This imported with no error.