Status, application, tenant and workflow option lists ignore the weight that orders them
Closes https://www.drupal.org/project/orchestra/issues/3625114
Every select that offers statuses, applications, tenants or workflows now lists them the way the entity type sorts itself: weight, then label (ConfigEntityBase::sort()).
TenantScopedRepositoryBaseloads the tenant's terms and sorts them; the ids method reads the same sorted list. This covers the node editor's status select, the workflow editor's application select and the scoped branches of the views filters.MyInstancesFilterForm(the requester's status filter) walks the vocabulary in that order instead ofnatcasesort(); a status whose term was removed follows the rest.InstanceFilterFormdrops its private copy of the tenant options and asksTenantContext::getTenantOptions(); its workflow select sorts by weight.WorkflowFilter, and the unscoped branches ofInstanceStatusandApplicationFilter, sort what they load.- The subprocess node's Child process select and the webform handler's Start workflow select, which listed workflows by machine name, sort the same way (added in the audit of this MR).
- With every weight at the default 0 the order is by label, natural and case-insensitive (
strnatcasecmp), as the admin lists already sort; the old config query compared labels byte by byte. - The views Workflow filter gains an
option_ordersetting, Order of the workflows: As arranged on the Workflows list (the default, weight then label, which is plain label order on a site that never arranges them) or By label, for a site with too many workflows to arrange by hand. Documented indocs/views.md. entity_mapping.neongainsorchestra_application, which #3624939 left out; without it phpstan types an application load as a bareEntityInterface.
Tests, each failing on the unfixed code: StateStatusViewsTest::testTheFiltersOfferTheirTermsByWeightThenLabel (three filters, both branches), InstanceListDisplayTest::testTheFilterSelectsOfferWorkflowsAndTenantsByWeight, MyInstancesControllerTest::testTheStatusFilterOffersTheVocabularyByWeight, SubprocessTest::testTheChildOptionsFollowTheWorkflowsOrder, OrchestraInteractionHandlerTest::testTheStartWorkflowOptionsFollowTheWorkflowsOrder, StateStatusViewsTest::testTheWorkflowFilterSetToLabelOrderOffersThemByLabel. Fixtures are named so machine-name, label and weight order all disagree.
AI-Generated: Yes (Claude Code found this in a pre-release audit and wrote the change and its tests.)