When importing an image style via the configuration import utility, the following fatal error is generated.
Steps to reproduce:
1. Visit: /admin/config/development/configuration/single/import
2. Import the image style config, sample:
uuid: 9184d3a9-a8c0-42f1-95ae-da02b09ac4b0
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: cCiWdBHgLwj5omG35lsKc4LkW4MBdmcctkVop4ol5x0
name: thumbnail
label: 'Thumbnail (100x100 test)'
effects:
f888edd2-ad2b-4995-b3cc-0cd01cb54b14:
uuid: f888edd2-ad2b-4995-b3cc-0cd01cb54b14
id: image_scale
weight: 0
data:
width: 100
height: 100
upscale: true
Expected result:
The updated image style configuration should be imported, however a fatal error is returned instead.
Actual result:
Error: Call to a member function read() on array in field_config_import_steps_alter() (line 294 of core/modules/field/field.module).
Comments
Comment #2
davidwhthomas commentedComment #3
tr commentedI was able to import your configuration without an error.
Comment #4
davidwhthomas commented@TR thanks for checking it, interesting to hear it's working for you.
Here's the full stack trace for the error from this end:
Not sure if core v8.5 vs 8.6 difference? as testing in v8.5.6
Can't see anything particular in relation to custom code in the stack trace but will continue investigating.
Comment #5
tr commentedI am using 8.6.x right now, but I would be surprised if there were any differences in image styles between 8.6 and 8.5 ...
Comment #6
davidwhthomas commentedI replicated the error on the clean install at https://www.opensourcecms.com/drupal/
The image style needs to be updated to return the error on config import
First import:
Second update import
Result:
The website encountered an unexpected error. Please try again later.( Same error detail can be seen in https://s1.demo.opensourcecms.com/drupal/admin/reports/dblog )Error: Call to a member function read() on array in field_config_import_steps_alter() (line 294 of /var/www/html-php7.1/drupal/core/modules/field/field.module) #0 /var/www/html-php7.1/drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php(539)Comment #7
tr commentedYes, if I try to import the config a second time I get the same error as you do. That seems to be the key step - importing once works, but modifying and importing a second time (with the same uuid of course) generates the above error.
I also tried this importing it twice without the _core key (which I believe is internal and doesn't appear in the export so shouldn't be in the import...), but this also failed.
I also tried importing, then exporting, editing, and importing again. Again, this also failed.
So I think you've found a bug. I can't say I've ever seen that on any other config type, and the traceback doesn't seem too helpful.
Comment #8
davidwhthomas commentedThanks for checking, after some debug, just noting the array that is returned from
field.module line 294$config_importer->getStorageComparer()->getSourceStorage()has the elementarray ('config_importer' => ... )as the top level key there, from the
Call to a member function read() on arrayWill keep investigating.
Comment #9
davidwhthomas commentedComment #10
eacute commentedSame problem here, but it s affecting my 8.6.1 while importing image_styles or entity_view_display.
Config to import :
Existing config :
It looks there is some difference in core with 8.5 vs 8.6 not in the config importation but with image styles Add crop anchor option to Scale and Crop image effect
Comment #11
eugis commentedI've got the same error importing "Node delete action"
Comment #12
pasqualleThis seems like a duplicate of #2976773: Single config import of image styles is broken
Comment #16
pameeela commentedThanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.
As part of the Bug Smash Initiative, we are triaging Drupal core issues with the priority 'Major'.
As suggested in #12 this seems like a duplicate of #2976773: Single config import of image styles is broken. I've just closed that as I cannot reproduce it on 9.0.x and reading through this ticket I can't see any different steps to reproduce. I have tried based on #6 importing the first config, then the second, then the first again but this all works as expected.
I can't find where this was fixed but it certainly seems to be!