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.
Pretty straight forward issue, the Elements module adds the HTML 5 email field to Drupal, it would be nice to use this as the widget for the Email field if it is available.
Patch incoming.
Comment | File | Size | Author |
---|---|---|---|
#4 | interdiff.txt | 1.39 KB | bgilhome |
#4 | email-support_elements-2500865-4.patch | 1.63 KB | bgilhome |
#3 | email-support_elements-2500865-3.patch | 758 bytes | bgilhome |
#1 | emailfield-2500865-1.patch | 1.44 KB | Deciphered |
Comments
Comment #1
Deciphered CreditAttribution: Deciphered at Realityloop for The Wilderness Society commentedComment #2
zaporylieI think there is no need to create new HTML5 widget here. I would opt for just changing field #type to 'email_emailfield' if Elements module is installed. It is like that for Telephone module.
But if you would prefer your approach more than the one I've suggested above, it could be easily done by new contrib micro-module (i.e. email_elements or elements_email). No need to wait for module maintainers to commit your patch.
Comment #3
bgilhome CreditAttribution: bgilhome commentedHere's a patch to check for 'elements' module and set form element type accordingly.
Comment #4
bgilhome CreditAttribution: bgilhome commentedActually we should also use only one element_validate callback if the elements module is installed - patch attached & interdiff to previous patch.
Comment #5
jackalope CreditAttribution: jackalope commentedThanks for the patch @bgilhome! I just encountered this need and your patch seems to be working well for adding HTML5 support via the Elements module.