Skip to content

Issue 427 SOP Checklist Picker Always Empty

Ed Mozley edited this page Nov 22, 2026 · 1 revision

🧾 #427 The Attach SOP checklists picker was always empty

GitHub #427, reported by @pappas81 Β· Workflows Β· fixed in 5.9.1 (#3114)

What you saw

In the workflow editor, adding the Attach SOP Checklist(s) action showed a Checklist Templates box that said No matching checklists, even with checklists for tickets set up in the Checklists module. Typing a checklist's name into the search box did not help, so nothing could be ticked, and a workflow saved like that attached nothing when it ran.

What was wrong

The workflow editor works offline: when the page loads, the server sends every list an action might need to pick from (statuses, priorities, analysts, teams...) in one go, as window.WF_ACTION_LOOKUPS. Each action argument says which list it needs with a lookup key.

The loop that builds those lists only looked at arguments whose type was lookup:

// workflow/editor.php (before)
foreach ($actionDefs as $actionKey => $def) {
    foreach (($def['args'] ?? []) as $argSpec) {
        if (is_array($argSpec) && ($argSpec['type'] ?? '') === 'lookup' && !empty($argSpec['lookup'])) {
            $lk = $argSpec['lookup'];
            ...

The checklist picker is a different kind of control - a searchable tick-list - so its argument has a different type, while still naming its list:

// workflow/includes/engine.php
'template_ids' => [
    'type'     => 'checklist_multiselect',
    'label'    => 'Checklist Templates',
    'lookup'   => 'checklist_template',
    'required' => true,
],

So checklist_template was never sent. The picker read WF_ACTION_LOOKUPS['checklist_template'], found nothing, fell back to an empty list, and drew No matching checklists - which is also exactly what it draws when a search has no results, so it looked like a search problem rather than a missing list.

The search box only filters the list it was given. With an empty list there is nothing to type your way to, which is why typing by hand did not attach anything either.

Was it ever working?

The loop has looked at the type since May, and the checklist action arrived in September with the checklist_multiselect type, so as far as the history shows the picker never received its list from this page. The server side was fine all along: asked directly, it returned every active ticket checklist.

It was one place, not several

Every action argument that names a list was checked. Only this one has a type other than lookup, so no other picker was affected.

The fix

Send the list for any argument that names one, whatever control draws it:

// workflow/editor.php (after)
// TRAP: any arg that names a lookup, not only type 'lookup' - the Attach SOP
// checklists picker is type 'checklist_multiselect' and drew "No matching
// checklists" when its values were never sent (GH #427).
if (is_array($argSpec) && !empty($argSpec['lookup'])) {

The lesson worth keeping: the argument already said what it needed (lookup). The loop asked a different question (type) that happened to give the same answer for every argument that existed when it was written.

πŸ“ Files

File Change
🟣 workflow/editor.php Sends the list for every argument with a lookup key

How it was verified

The editor page was opened on a test install and the lists it hands the browser were counted:

checklist_template in WF_ACTION_LOOKUPS
Before (control, old code) missing
After 5 checklists - the five active checklists for tickets or both

Tasks-only checklists stay out of the list, as before: the list still comes from the same rule, which offers checklists for tickets and for both.

What this means for you

Upgrade to 5.9.1, open a workflow with the Attach SOP Checklist(s) action and tick the checklists you want. A workflow saved before the fix with nothing ticked attached nothing; it needs the checklists ticked and saving once.

Related

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally