Pseudoconstants - Use id instead of label for name
authorColeman Watts <coleman@civicrm.org>
Tue, 8 Feb 2022 16:55:32 +0000 (11:55 -0500)
committerColeman Watts <coleman@civicrm.org>
Tue, 8 Feb 2022 21:11:52 +0000 (16:11 -0500)
commit79e6ec68bf36402e59147e0a62618d79e45c48e0
treea3f1b2a32596b398a194f6c9bf3c732b80fe3bfe
parent6686bf449010981aaae33645e910330435930115
Pseudoconstants - Use id instead of label for name

Each item in a field option list contains keys like id, name, label, color, icon, description, abbr.
But some option lists only consist of simple key/value pairs. To convert those simple associative arrays
into a full option list, the name should be derived from the id, not the label, because machine names
are expected to be stable, and labels can be translated.

Before: `name` derived from `label` when converting simple associative to an option list
After: `name` derived from `id`.
CRM/Core/PseudoConstant.php
Civi/Api4/Generic/BasicGetFieldsAction.php
ext/search_kit/tests/phpunit/api/v4/SearchDisplay/SearchRunTest.php
tests/phpunit/api/v4/Action/BasicActionsTest.php
tests/phpunit/api/v4/Entity/MembershipTest.php