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.
I just noticed that the required checkbox on the product creation/edit form for text field attributes doesn't make the field required. Tt works as intended for select list type attributes. The only way to make a text field required is to set the field to required on the option set field settings which makes it required everywhere, and not on a product by product basis. See screenshots of a text attribute and list attribute that are both set as required on the product but only the list is required on the add to cart form.
Comment | File | Size | Author |
---|---|---|---|
#2 | required_text_fields-2259137-2.patch | 1.08 KB | aramboyajyan |
attribute-required-2.JPG | 11.04 KB | brogdawg | |
attribute-required.JPG | 20.53 KB | brogdawg |
Comments
Comment #1
aramboyajyan CreditAttribution: aramboyajyan commentedI can confirm that this issue exists; will post here if I find a patch.
Comment #2
aramboyajyan CreditAttribution: aramboyajyan commentedAttached is the patch. It appears to be working on my end - someone else please test this as well.
Updating the status and assigning this issue to myself.
Thanks!
Comment #3
stebentje CreditAttribution: stebentje commentedPerfect, the patch works, many thanks!
Comment #4
GiorgosKeven if I set the option "required" in the option set
as the original poster says the -none- appears as an option
if I actually set each option to default not to "none" than the "none" dissapears
but that means we are forcing the user to select the default options everytime they create and option set
the patch applied cleanly to "7.x-1.0-beta4"
but does not work as expected