afform - Get default field <label>
from label
instead of title
#18989
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This updates
afform/core
andafform/gui
to use better default labels -- e.g. when you add thegender_id
field, it should default to "Gender" (label
) instead of "Gender ID" (title
).Before
<Entity>.getFields
returned atitle
. Thetitle
describes a field somewhat abstractly (e.g.gender_id
has the titleGender ID
).title
was used as the default.title
.After
<Entity>.getfields
returns both atitle
andlabel
. Thelabel
is simpler / more end-user-y string (e.g.Gender
vsGender ID
).label
was used as the default.label
.Comments
This is technically a breaking-change for anyone who has overridden the default
title
- they would have to re-enter it as alabel
override. Ideally, this would be transitioned for compatibility -- but we don't have the validation/migration mechanism yet. There's a reasonable argument that it's not important to have a migration for this field at the current stage of development. More discussion on Mattermost: https://chat.civicrm.org/civicrm/pl/btbh1n88tp88zx39ean8gtgjkeNote that the PR adds an item about the BC break to the auditor backlog, which has a list of things that should be included in validation/migration.
CC @colemanw @eileenmcnaughton