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']

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tien.xuan.vo’s picture

Status: Needs work » Needs review
FileSize
927 bytes

Add simple patch

swentel’s picture

Hmm 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.

tien.xuan.vo’s picture

Issue summary: View changes
swentel’s picture

Haza’s picture

FileSize
13.93 KB
9.66 KB

Patch still apply, and I can confirm the issue.

Without the patch, we ImageWidget::process is called twice

With 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.

Haza’s picture

Issue summary: View changes

Status: Needs review » Needs work

star-szr’s picture

Status: Needs work » Needs review

Just testbot having a bad day.

Haza’s picture

Status: Needs review » Reviewed & tested by the community

Since 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 !

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This 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!

  • alexpott committed fd23cc5 on 8.0.x
    Issue #2358409 by tien.xuan.vo, Haza: image_image field element is...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.