- 🇨🇦Canada jglynn
Seems like this is still not fixed? Is https://www.drupal.org/project/image_field_repair → still required?
Displaying images that were uploaded at the same time (selecting mulitple images) are broken. The height/width from the first image are applied to all images.
Use Image Field Repair → module to restore corrupted images and to fix core bug (since 8.x-1.2 release).
The width/height attributes on the image tag are the same (those of the first image), even if the images we uploaded does not have the same dimensions.
When you overload an ImageWidget with multiple files selected at once from the remote client, the form system needs first of all to transform the single widget with n files to n widgets with one file each. This is managed by the methods ::massageFormValues
and ::submit
. Before transforming, the widget process stores the dimensions of the first image in two hidden fields of the initial widget. The transformation is done by adding multiple widgets in the form array, copying them from the first widget. Now that's the gotcha. The transformation is managed within the FileWidget code, that ImageWidget inherits from - and FileWidget has no code to deal with image dimensions. So the additional widgets are copied with the same hidden fields values of the first file.
Implement ::massageFormValues
and ::submit
methods in ImageWidget
, taking from the parent FileWidget
class , and changing them to ensure that image width and image height values do not carry over from the initial widget to its copies.
None.
None.
None.
Fixed
8.9 ⚰️
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Seems like this is still not fixed? Is https://www.drupal.org/project/image_field_repair → still required?