Postponed (maintainer needs more info)
Project:
Drupal core
Version:
main
Component:
field system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Aug 2012 at 09:28 UTC
Updated:
2 Jul 2025 at 14:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dave reidComment #2
larowlanFirst go
Comment #3
plopescHello
After #1668332: Add an E-mail field type into core, providing a patch where the field architecture is based in a separate submodule.
Tests has been included in this approach.
Regards
Comment #4
moshe weitzman commentedI think we should have a use case before adding it, or else it stays in Contrib. Add 'Favorite color' to the User entity? :)
Comment #5
swentel commentedYeah, I guess this is D9 material
Comment #6
catchComment #7
jurriaanroelofs commentedAs a theme/site-builder tool developer I can think of use cases for this. color fields would be nice to implement per-node, per-context, per-role etc. design variations to theme regions or dynamic content.
Comment #12
pere orgaThe module on its own would not be very useful. But whether it is in core or in contrib, it would allow to build solutions such as the ones described in #7. The only advantage I see of having it in core would be that contrib modules and themes would be able to use it immediately. Maybe that's why the color element was added to Form API.
There are at least 3 different modules that provide a color field type:
https://www.drupal.org/project/jquery_colorpicker (7.x, 8.x)
https://www.drupal.org/project/color_field (7.x, 8.x)
https://www.drupal.org/project/colorfield (only 7.x for now)
Unfortunately all of them are more complex, add more stuff and/or require using external libraries. Ideally, if these modules needed to exist they should be extending the Form API/field core's functionality.
About adding it as a contrib project: @larowlan @plopesc have you considered creating the project? I could also create it, as I need this functionality right now and I was thinking to use it for future 8.x versions of https://www.drupal.org/project/field_group_background_image. By the way, I see that the name "color_field" is already in use by the existing Color Field contrib module (and has 8.x releases...)
Comment #13
plopescHi Pere,
That'd be great and I would be happy to help with that, but as you pointed we now have the namespace issue. We cold use "rgb_field" as less bad option.
Other option would be to try to contact with color_field/colorfield maintainer and ask them to create new branches to use as color API module and then create multiple submodules adding extra features or using external libraries.
Comment #14
pere orgaHi,
Even if that may be possible, I was wondering if having this new module as a separate project would be a better option. Nowadays all major browsers support input type color; if a polyfill is desired to add support for older browsers, that polyfill should work for all form fields, not just Field API fields, and therefore it would make sense to have it as an external project. That way the polyfill could be used for a broader audience.
Adding external libraries would harden maintenance, and that would favor only one or a few libraries, not necessarily the best ones.
By the way
rgb_fieldname sounds acceptable to me.Comment #22
pere orgaFWIW, I see that now there is Color API contrib module (used by Jquery Colorpicker), and that Color Field also gained input type=color support.
Comment #26
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #27
catchThere are about 30,000 Drupal 8+ sites using https://www.drupal.org/project/color_field, which is a fair amount, but I'm not sure it's enough to justify adding the field type to core. We're already considering moving telephone to contrib since that isn't widely used. Moving this to the core ideas queue for new feature evaluation.
Comment #28
catchMoving this to Drupal CMS - if this field was in heavy use in Drupal CMS or experience builder, then it could end up being a core candidate, but if not, I think it is fine for it to live in contrib.
Comment #29
pameeela commentedWe have no need for it now, so I don't see any reason to keep this open. Generally our approach is to add a module as the need arises, so if in future we need it, we will add it.
Comment #30
pere orgaLet's go back to Drupal core then.
Also, note that https://www.drupal.org/project/color_field module has currently 53,021 reported installs, which as of now it is more than what Drupal CMS has. So there is at least some "need".
Comment #31
pere orgaComment #32
pere orgaComment #33
catchFor core evaluation this first needs an issue summary update for what exactly is being proposed for addition for core, who is planning to do the work, whether it would start as an experimental module etc., and then once that's available it will need product manager review.
Comment #34
pere orgaRemoving "Needs product manager review" tag, as I understand the stated steps need to happen first