[non-unique] IDs contain spaces on product multivariants

Started by man.of.earth, November 03, 2019, 20:56:48 PM

Previous topic - Next topic

man.of.earth

Hello,

I noticed that in displaying product multivariants as radio buttons - product with child-products (I don't know about list elements of other ones) with custom labels that contain spaces, the IDs generated contain spaces, which makes the page to not validate:
Error: Bad value [mare (100 x 67 cm) for attribute for on element label: An ID must not contain whitespace.

From line 13, column 56332; to line 13, column 56405

controls> <label for="[mare (100 x 67 cm)" id="[mare (100 x 67 cm)-lbl" class=radio> <inpu

Error: Bad value [mare (100 x 67 cm)-lbl for attribute id on element label: An ID must not contain whitespace.

From line 13, column 56332; to line 13, column 56405

controls> <label for="[mare (100 x 67 cm)" id="[mare (100 x 67 cm)-lbl" class=radio> <inpu

Error: Duplicate ID [mare (100 x 67 cm).

From line 13, column 56407; to line 13, column 56610

ss=radio> <input type=radio name=field[24][148][customfield_value][0] id="[mare (100 x 67 cm)" value="mare (10...67 cm)" checked=checked class=" cvselection no-vm-bind" data-dynamic-update=1 data-cvsel=field148 />mare (

Warning: The first occurrence of ID [mare (100 x 67 cm) was here.

From line 13, column 39531; to line 13, column 39734

ss=radio> <input type=radio name=field[39][140][customfield_value][0] id="[mare (100 x 67 cm)" value="mare (10...67 cm)" checked=checked class=" cvselection no-vm-bind" data-dynamic-update=1 data-cvsel=field140 />mare (


Also, in browse views, when multiple products with children are shown with the same variants names (standard sizes, for example - see here: https://www.proxima-mundi.ro/printuri-pe-canvas-foto-n ), there are generated multiple non-unique IDs with the same name, which makes that selection of a certain variant to not be made correctly (i.e. you select one variant for one product, and it is selected that variant, but from another product :D ).

I think a good idea to generate unique IDs would be simply product_id (i.e. product_78), or maybe there is another even simpler solution.