- Issue created by @dww
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Would copying part of the code from that module (with a crediting comment) a viable solution?
- ๐บ๐ธUnited States dww
This page is intended to teach people how to create a custom entity type and define its base field properties. Itโs not really intended to educate potential readers on gender politics and reality, and getting into the details of defining a custom field is out of scope.
I think the two options I put in the summary would be best: either add a lot more allowed values here (and make the field optional), or just come up with a simple, benign example property where only 2 or 3 allowed values makes sense. Something silly like โFavorite primary colorโ with allowed values of blue, red and yellow.
For the sake of simplicity Iโm leaning towards primary color or something, since gender is an inherently complicated topic.
- Status changed to Needs review
about 1 year ago 7:36pm 4 January 2024 - ๐บ๐ธUnited States dww
Added a specific proposal to the summary for consideration. I'm leaning towards option #2.
Also, by using
'blue' => 'Blue'
(with different capitalization) it hopefully makes it more clear (?) that the array index is the machine value and the array value is the human-readable label used... - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Strings shown in the user interface must be translatable. That should be enough to differentiate them. ๐ ๐ค
- ๐บ๐ธUnited States dww
Hehe, whoops. I was confused because they're field settings, but since they're base fields being defined in code, you're totally right. Thanks!
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Looking at the example code, I noticed it defines fields that make sense for an entity which I guess could be used for people who needs to be contacted. (I assume the difference with the User entity is that the latter contains login information.)
In this case, would not a field like Work department make more sense than a Favorite Primary Color field? It would still be a list_string field with allowed values, like the Gender field, but it would not touch a inherently complicated topic. - ๐ณ๐ฟNew Zealand quietone
I am glad to see this issue.
I support the "simple, benign example" or colors. The idea of "Work department" is making an assumption that everyone 'works in a department' and I don't think we should do that. Would that even make sense for a Drupal web site for an organization run by volunteers? In this case, I speak from experience. I have spent a large portion of my life in volunteer positions and have been annoyed more than once by official forms that recognize paid work but not unpaid work. And while I have never had a favorite color, it is simple and demonstrates the concept.
- Status changed to Fixed
about 1 year ago 8:39pm 5 February 2024 - ๐บ๐ธUnited States dww
Great, thanks! Instead of letting perfect be the enemy of good, since there are at least 2 of us in agreement that 'Favorite Primary Color' is better, let's go with that. It's only a stale handbook page, after all. ๐ Let's fix the bug and move on.
https://www.drupal.org/node/2192175/revisions/view/13394743/13404985 โ
Thanks again,
-Derek - ๐บ๐ธUnited States dww
Oh whoops, I don't have perms to save credits in this queue. @quietone, would you be willing to credit all of us?
- ๐ณ๐ฟNew Zealand quietone
This really is a welcome improvement! Thanks!
Automatically closed - issue fixed for 2 weeks with no activity.