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.
Using this with Drupal Commerce and set list to contain "Mr" and "Mrs" only.
In the ordering process the Title appears at the top of the address with "Please choose".
The field is NOT optional and in the list there is only "Mr" and "Mrs".
How can I make the field optional (no red asterisk) and/or accept something like a "-none-" value.
(i.e. at /admin/commerce/customer-profiles/types/billing/fields/commerce_customer_address
)
Comment | File | Size | Author |
---|---|---|---|
#6 | no_optional_option_or-2617616-1.patch | 2.16 KB | saurabh.dhariwal |
Comments
Comment #2
jamescook CreditAttribution: jamescook commentedComment #3
jamescook CreditAttribution: jamescook commentedComment #4
jamescook CreditAttribution: jamescook commentedWell it's hard-coded in plugins/format/title.inc
Quick and dirty fix - In the above change #required to FALSE
Though really this should be an admin option in the GUI
Comment #5
attisanif you do so, don't forget to fix_addressfield_title_render_address to this:
Comment #6
saurabh.dhariwal CreditAttribution: saurabh.dhariwal at AddWeb Solution Pvt. Ltd. commentedAdded admin option for making the field optional in the GUI.
Comment #7
saurabh.dhariwal CreditAttribution: saurabh.dhariwal at AddWeb Solution Pvt. Ltd. commentedComment #8
adam1 CreditAttribution: adam1 commentedI used the above patch (thank you for that!) on latest stable & dev. While the patch works, there's a bunch of ugly arnings thrown out:
Maybe this issue is analogue to that one from its sister-module addressfield_phone:
https://www.drupal.org/node/2409695
Unfortunately I am not a developer, so I can't fix this for my own. Any help very much appreciated!