With webform_image_select not entering anything for Image value or Image text results in all options but one being overwritten.

How to reproduce
* add a webform_image_select element
* enter/select two images, no value or text
* save
* re-edit the element: only one option (I think the second/last) is saved

Proposal for solutions:
* either the value/text ought to be required
* or the value gets set automatically if missing (e.g. 1,2,..)

Comments

miiimooo created an issue. See original summary.

miiimooo’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

A first stab at this..

jrockowitz’s picture

StatusFileSize
new5.25 KB

The attached patch fixes the issue with is the multiple element's unique key validation is completely ignoring empty keys.

  • jrockowitz committed e369137 on 8.x-5.x
    Issue #3009833 by miiimooo, jrockowitz: Image options removed when no...
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch. Please download the latest dev release to review.

miiimooo’s picture

I can confirm that leaving the value/text empty now sets a form error.

Thanks @jrockowitz for fixing this so quickly!

miiimooo’s picture

StatusFileSize
new3.89 KB

Not sure this is something you want but I've re-rolled the patched for rc21 since dev had some stuff I didn't want (yet).

Hope it's useful for someone else.

Status: Fixed » Closed (fixed)

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