Three findings of the whole-tree audit of 1.x at 7c9f1b2a, all of them one thing said more than once.

The delete guard, written three times. Status::preDelete() and Workflow::preDelete() are the same 22-line guard: load the usage service, skip a sync or an uninstall, count the references, format them, throw. A diff of the two method bodies puts exactly three changed lines between them, the service id, the interface and the sentence. Tenant::preDelete() is the same shape a third time, with its own default-tenant case on top. The module already owns EntityCountLabelsTrait for the other half of this job, and drove identical-body duplication to zero in #3619693. The copies also leave the exception rendering the counts as 3 orchestra_instance, while the three delete forms render the same counts through that trait as 3 process instances, so one refusal reads two ways depending on which surface asks.

A byte-identical preRender(). TaskActionLink and TaskOperations, two sibling Views field handlers in orchestra_inbox_views that already share AssignmentCacheTrait, carry the same preRender() down to its comment: apply the assignment cacheability, collect the row entities, warm the caches. The same pair also repeats the query()/clickSortable()/link-text option block that orchestra_views own action-link field carries.

The shipped State column keyed as status. Orchestra is careful that the engine state and the workflow-authored status are different things, and the instance views key them accordingly: status for the authored status, state for the engine state. Three shipped views file the engine or work-item state under the key status instead, residue of the status to state rename: views.view.orchestra_tokens, views.view.orchestra_trace and views.view.orchestra_inbox. A site builder who duplicates one of them and adds the real Status column gets it keyed status_1, and anything reading fields.status, which is the shape the shipped card preprocessors use, reads the engine state instead.

Proposed resolution. One shared guard for the three config entities, reporting the counts the way the forms already do; one warming for the two handlers; and the three views keying State as state. Each with a test.

AI-Generated: Yes (Claude Code was used to help draft this issue summary and to write the code and tests on the merge request. I reviewed and ran the work myself before posting it.)

Issue fork orchestra-3623043

Command icon 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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed 7c196e3c on 1.x
    task: #3623043 Share the config-entity delete guard and the task-row...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.