Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
ImageWidget::process
is called twice on an image field. The reason is that ImageWidget::formElement
call parent::formElement
which add ImageWidget::process
to #process of the form element, then again add ImageWidget::process
to #process of the element itself.
Expected: ImageWidget::process
appear 1 time in $element['#process']
Actual: ImageWidget::process
appear 2 times in $element['#process']
Comment | File | Size | Author |
---|---|---|---|
#1 | image-image_image_field_element_is_processed_twice-2358409-1.patch | 927 bytes | tien.xuan.vo |
Comments
Comment #1
tien.xuan.vo CreditAttribution: tien.xuan.vo commentedAdd simple patch
Comment #2
swentel CreditAttribution: swentel commentedHmm right and process is also calling its parent. I actually changed that process in #2172241: Files and image widgets completely broken because there were problems with rendering, we need to make sure we don't introduce that regression again, but since this patch is green it's most likely to be ok as there's a test for it, so should be good to go.
Comment #3
tien.xuan.vo CreditAttribution: tien.xuan.vo commentedComment #4
swentel CreditAttribution: swentel commentedThought that #2349835: image upload max size gave double errors, but it's not.
Comment #7
HazaPatch still apply, and I can confirm the issue.
Without the patch, we
ImageWidget::process
is called twiceWith the patch, we now only have one call.
Let's re-test the patch, and if it is green, I guess we can mark this issue as RTBC.
Comment #8
HazaComment #11
star-szrJust testbot having a bad day.
Comment #12
HazaSince swentel was OK (7 months ago) and the patch is still green and is doing what it should, it seems that we can RTBC this one !
Comment #13
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed fd23cc5 and pushed to 8.0.x. Thanks!