8

I have some configuration that will not import. If I run drush config-import --preview I see the changes to be imported; I hit 'y' to import. When I run the same command, the changes are still there?

My guess is that when I run this command the config files should say to the database: 'hey, be like me'. Then when I run it again, Drupal should ask 'are the config files and database the same?' - they should be if they were synced - and Drupal should say 'cool, nothing to do, they match'. Right?

Am I missing something - if not, what can I do? Thanks.

$ drush config-import --preview
 Collection  Config                                            Operation                
             core.entity_view_display.node.page.search_result  update 
             core.entity_view_display.node.page.search_index   update 
             core.entity_view_display.node.book.teaser         update
Import the listed configuration changes? (y/n): y
The configuration was imported successfully.                                                                                                                                                     [success]
$ drush config-import --preview
 Collection  Config                                            Operation                
             core.entity_view_display.node.page.search_result  update 
             core.entity_view_display.node.page.search_index   update 
             core.entity_view_display.node.book.teaser         update
Import the listed configuration changes? (y/n): 
3
  • I've also experienced this.
    – Kevin
    Feb 11, 2017 at 18:47
  • I'm moving the config from my dev site to stage site. All I can think to do is delete the stage database and replace it with the dev database. Then the flies will be out of sync - so I'd have to copy those over too.
    – dbj44
    Feb 11, 2017 at 22:42
  • cache is rebuilt ?? run --preview diff to see the actual changes - maybe they're different ..
    – rémy
    Feb 21, 2017 at 8:41

2 Answers 2

0

From what I can see this is a problem with how drush generates the temp files to compare against. It looks like drush is generating files with any comments removed as well as not adding qoutes around yaml strings that needs to be escaped.

+  # Set the node type to location
   type:
     plugin: default_value
     default_value: location
+  # set the location type to park
   field_location_type:
     plugin: default_value
     default_value:
       tid: 1
+  # Create the mappings from soap to drupal fields.
   title: abbreviatedName
   field_location_active_facilityid: ID
-  field_location_address/address_line1: address1
-  field_location_address/locality: city
-  field_location_address/administrative_area: state
-  field_location_address/postal_code: zipCode
-  field_location_address/country_code: country
-  field_location_parking_direction/format:
+  "field_location_address/address_line1": address1
+#  "field_location_address/address_line2": address2
+  "field_location_address/locality": city
+  "field_location_address/administrative_area": state
+  "field_location_address/postal_code": zipCode
+  "field_location_address/country_code": country
+#  "field_location_address/langcode":
+#    plugin: default_value
+#    default_value: en
+  "field_location_parking_direction/format":
     plugin: default_value
     default_value: basic_html
-  field_location_parking_direction/value: parkingCapacity
+  "field_location_parking_direction/value": parkingCapacity
0

I have seen this, too. Sometimes the configuration seems to be modified during or after the import thus there will be a difference between what is on disk and what is in the database.

It may be a module acting on the import event by adding its own default settings to the configs.

It could help to re-export the configuration and compare the result with the original files in order to understand what is going on.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.