Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
image.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2014 at 06:46 UTC
Updated:
18 Sep 2017 at 14:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
slashrsm commentedComment #2
swentel commentedCan't seem to reproduce, is this still an issue ?
Comment #3
jhedstromI'm guessing this was a passing issue. Feel free to re-open if it is still happening.
Comment #4
caspervoogt commentedI just encountered this in rc1, clean install with Standard profile. Steps to reproduce;
Comment #5
jhedstromComment #6
caspervoogt commentedI am going to be dealing with this fatal error some more in coming days and hope to report back with some more details then. I hope others can reproduce this though.
Comment #7
jhedstromI'm still unable to reproduce this, even following the steps in #4. That first issue:
Seems like it is probably at the root of this. I do not get broken thumbnails on user images with a clean install.
Do you see anything out of the ordinary on the status report page?
Comment #8
dave reidComment #9
caspervoogt commented"Seems like it is probably at the root of this. I do not get broken thumbnails on user images with a clean install."
I have been playing around with it, just saving and re-saving some field / storage settings, and no longer get the fatal error. It did happen though, and shouldn't have - I just can't say for sure at this point what triggered it.
The situation now is that the default image I have set will not display - it gives a 403 Forbidden error. In fact, what seems to be happening is the default_images folder is not being created.
Example:
The thumbnail URL is:
/system/files/styles/thumbnail/private/default_images/default%20picture_2.png?itok=DP8YwAK1
But /system/files/styles/thumbnail/private/default_images does not exist although /system/files/styles/thumbnail/private does exist, while /system/files/default_images does exist and does contain the uploaded files, with correct permissions/ownership (even tried chmod 777 and ownership www-data:www-data, as a sanity check!!!).
I think perhaps I should have set the private file path and ensured correct ownership/permissions before messing at all with the User Picture settings, but permission issues still should not cause fatal errors; worst case it should result in a warning that the file can't be written. I'm unsure what exactly triggered it, at this point. I would need to run through it again from a fresh install, and properly document it.
Comment #10
caspervoogt commentedComment #11
caspervoogt commentedComment #15
alex.ksis commentedI think, I found where is the error.
It happens because in the image_field_storage_config_update function, property $file_new->filename is used as string, however entity property returns an instance of the Drupal\Core\Field\FieldItemList class.
Please, check the attached patch.
Comment #17
0sarah0al commentedThanks @alex.ksis
I applied your patch and it worked.
Comment #18
amateescu commentedYou can simply use the
getFilename()method of the File entity :)Comment #19
alex.ksis commented@amateescu you're right, here is the new patch
Comment #20
amateescu commented@alex.ksis, looks much better now :)
Turns out that this issue is quite easy to reproduce, I'll update the issue summary. Also wrote some tests for this.
Comment #22
berdirYay, tests. Looks good :)
Comment #23
catchNeeds a re-roll.
Comment #24
amateescu commentedRerolled after #2903332: Regression: lost test coverage for handling default images in the Image field.
Comment #26
catchCommitted/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!