Active
Project:
Drupal core
Version:
main
Component:
file.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2020 at 11:12 UTC
Updated:
11 Dec 2020 at 11:12 UTC
Jump to comment: Most recent
Discovered in #2644468: Multiple image upload breaks image dimensions, FileWidget and ImageWidget have the following code in their submit methods:
foreach ($submitted_values as $delta => $submitted_value) {
if (is_array($submitted_value['fids'])) {
$first = TRUE;
foreach ($submitted_value['fids'] as $fid) {
$new_value = $submitted_value;
$new_value['fids'] = [$fid];
if (!$first) {
unset($new_value['width'], $new_value['height']);
}
$new_values[] = $new_value;
$first = FALSE;
}
}
else {
$new_value = $submitted_value;
the $new_value in the else is not used anywhere further.
Investigate what is the correct solution and fix.
Comments