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()).

  • TenantScopedRepositoryBase loads 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 of natcasesort(); a status whose term was removed follows the rest.
  • InstanceFilterForm drops its private copy of the tenant options and asks TenantContext::getTenantOptions(); its workflow select sorts by weight.
  • WorkflowFilter, and the unscoped branches of InstanceStatus and ApplicationFilter, 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_order setting, 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 in docs/views.md.
  • entity_mapping.neon gains orchestra_application, which #3624939 left out; without it phpstan types an application load as a bare EntityInterface.

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.)

Edited by Frank Mably

Merge request reports

Loading
Loading