Problem/Motivation
We want to add Height and Weight as fields in the CRM system. These are neutral demographic fields useful for reporting, analytics, and integrations. Currently, they are not available in the Person contact type.
Considerations include storing data in metric units while allowing formatting in other systems (e.g., imperial units) and making the fields optional. We also want to leverage existing contrib modules if available to avoid custom development.
Steps to reproduce
1. Go to the Person contact type.
2. Attempt to add Height and Weight fields.
3. Observe that these fields are not available by default.
Proposed resolution
1. Add Height and Weight fields to the Person contact type as optional fields.
2. Store values in metric units (cm for height, kg for weight).
3. Provide formatters to display values in imperial units where needed.
4. Investigate and integrate existing contrib modules for height and weight fields.
5. Follow Drupal best practices for field storage, widgets, and formatters.
Remaining tasks
- Research existing contrib modules for height and weight.
- Decide whether to add these fields by default to the Person contact type.
- Implement fields with proper field widgets and formatters.
- Test field storage, display, and conversion between metric and imperial units.
User interface changes
New optional fields for Height and Weight will appear in the Person contact type forms. Formatters will allow display in either metric or imperial units depending on the configuration or output requirements.
API changes
No core API changes expected. New field definitions and formatters will be available for programmatic access via standard Drupal field APIs.
Data model changes
New fields will be added to the Person contact type:
- Height: Decimal, stored in centimeters.
- Weight: Decimal, stored in kilograms.
Both fields are optional and can be converted for display in other units.
Issue fork crm-3554373
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
bluegeek9 commentedComment #3
bluegeek9 commentedThis project might be what we need. https://www.drupal.org/project/physical
Comment #4
jdleonardI agree that project looks very promising.
Comment #5
jdleonardFixing version.
Comment #6
bluegeek9 commentedMaking a plan to indicate that this is meant for discussion before implementation. The ultimate solution might not seide in the crm namespace/project.
Comment #7
bluegeek9 commentedI think a recipe for height and a recipe for weight using the Physical project.
Comment #8
bluegeek9 commentedComment #11
bluegeek9 commented