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.
Updated: Comment #0
Problem/Motivation
Part of #2150511: [meta] Deduplicate the set of available field types.
Proposed resolution
Move email
and number
modules code into \Drupal\Core\Field\Plugin\Field
.
API changes
removal of email and number modules
Comment | File | Size | Author |
---|---|---|---|
#8 | 2218199-email-number-fields-8.patch | 52.7 KB | andypost |
#8 | interdiff.txt | 3.21 KB | andypost |
#1 | 2218199-email-number-fields-1.patch | 52.77 KB | andypost |
Comments
Comment #1
andypostRe-roll of #2150511-47: [meta] Deduplicate the set of available field types
Comment #2
tim.plunkettComment #3
sunCan we move the field type specific tests into field type specific subdirectories?
cf. #2202925: Move simple field types into Core/Field
Comment #4
andypostSuppose better to have special sub-folder 'Fields' like there's a Views one
Comment #5
BerdirNot sure about Fields as a sub-namespace, everything in fields.module is about fields?
FieldTypes maybe, but I agree with @sun that \Drupal\field\Tests\Email or so would make more sense.
Comment #6
andypostFiled #2218245: Move field types tests to separate folder
Suppose better to have
FieldTypes
folder because there'sShapeItemTest
andTestItemTest
Comment #7
sunThe separation into field type specific test subdirectories (for the moved files only) should be done directly in this patch, IMHO.
I actually spent a lot of time to think through and try out possible constellations in #2202925: Move simple field types into Core/Field, and it actually was @yched who raised the concern that all of those tests would/could end up in a single directory (dumping ground), which would be a regression compared to the cleanly separated tests we have right now.
Let's move those tests into corresponding \Tests\Email and \Tests\Number subdirectories/namespaces, please. There's really no reason to hold that up on any possibly preexisting Field module test classes (and also no need to touch any preexisting files, as that would be out of scope here).
Comment #8
andypost@sun, I still don't get the reasons to separate folders but... as you wish
Comment #9
andypostChange records to update:
https://drupal.org/node/2164623 number and email needs update
https://drupal.org/node/2186029s/email/text - updatedhttps://drupal.org/node/2111927fixed in #2192259: Remove ConfigField.. Item and List classes + interfaceshttps://drupal.org/node/2064123 is not affected
https://drupal.org/node/1796546 the same
https://drupal.org/node/1805846 number classes should be updated
https://drupal.org/node/1388376 reference to number module
Comment #10
Berdirnumber already exists in 7.x, no idea what it is doing in https://drupal.org/node/2164623? should be removed from that. However, it should be added to https://drupal.org/node/2116417.
I don't think this needs separate change notice.
Clarifying the title a bit, we don't move the modules to Drupal\Core\Field but the field types and their widgets/formatters.
I think this is RTBC, pending an approval from a core committer.
Comment #11
sunThanks — this patch looks great to me!
Comment #12
webchickWhile number totally makes sense to move to core as a "native" field type, I was a bit confused why we did that for email, which seems more optional. But andypost pointed out that "core" core entities like User use it, and would ideally not be requiring an optional core module to do so. It's also a native HTML5 field type now, so that's probably another reason.
Looks like #9 enumerates all the places that need to be updated for this.
Committed and pushed to 8.x. Thanks!
Comment #13
andypostUpdated change notices
https://drupal.org/node/2164623/revisions/view/7030625/7031029 about email field
https://drupal.org/node/2116417/revisions/view/6823053/7031041 about number field
https://drupal.org/node/1388376/revisions/view/1815250/7031047 changed to numeric fields
https://drupal.org/node/1805846/revisions/view/6981083/7031125 example updated
Comment #14
sunWe still need to remove the drupal.org issue queue "components" — they were introduced during the D8 cycle:
https://drupal.org/project/issues/drupal?component=email.module
https://drupal.org/project/issues/drupal?component=number.module
email.module is empty, great. number.module is not.
What do we do?
I really liked the clean separation of issues to get filed against discrete field types, and I think I'd really dislike to go back to a never-ending dumping ground of "field system"... — a new and smaller dumping ground of "field types" might work, although searching for issues against a particular field type will be cumbersome, since the field type names are very generic keywords (i.e., searching for "number", even when filtered to a "field types" component, will yield many false-positive results).
Comment #15
yched CreditAttribution: yched commentedVery much +1.
Also true in terms of maintainers, being a "Field API" maintainer doesn't mean I sign up to maintain all field types / widgets / formatters in Core/Field :-)
The fact that "a field type / a collection of related field types" is now scattered betwen "FieldType folder containing lots of other field types + a FieldFormatter folder containing lots of other formatters + a FieldWidget folder containing etc..." doesn't help with clarifying responsibilities, but maybe a set of separate "number fields", "text fields" ... components would be needed nonetheless.
Comment #16
webchickI removed email.module, since that was introduced in D8. number.module was in D7 though, so we might as well keep it around for issue organization purposes in D8 until we find a better way.