Short description of the issue
Commit 508ef78b introduced the new flagsCli bit that drives CLI module discovery via findByFlag(Modules::flagsCli). The bit is populated only by ModulesFlags::setFlags(), which runs during install or refresh. Installs with already-installed modules that declare 'cli' => ... in their info will not be discovered until the user runs a Modules refresh.
Expected behavior
After upgrading to a version that supports CLI modules, php index.php list (or equivalent) discovers all installed CLI modules without requiring a manual refresh.
Actual behavior
In wire/core/Modules/ModulesFlags.php:
setFlags() calculates flagsCli from $info['cli'] only during install/refresh.
- Existing modules in the DB still have their old flags row, with
flagsCli unset.
findByFlag(flagsCli) returns nothing, so getCliModules() falls back to module-name lookup. Explicit php index.php SomeModule calls work; the help listing silently omits pre-existing CLI modules.
Optional: Suggestion for a possible fix
Either:
- Auto-refresh flags on first CLI invocation (cheap, defensive).
- Run a one-time flag backfill at module-system init when
flagsCli is missing from the flag schema.
- Document the need to run "Modules → Refresh" after upgrade in the release notes.
Setup/Environment
- ProcessWire version:
dev @ 15c749ed
- File:
wire/core/Modules/ModulesFlags.php
- Introduced in commit 508ef78b
Short description of the issue
Commit 508ef78b introduced the new
flagsClibit that drives CLI module discovery viafindByFlag(Modules::flagsCli). The bit is populated only byModulesFlags::setFlags(), which runs during install or refresh. Installs with already-installed modules that declare'cli' => ...in their info will not be discovered until the user runs a Modules refresh.Expected behavior
After upgrading to a version that supports CLI modules,
php index.php list(or equivalent) discovers all installed CLI modules without requiring a manual refresh.Actual behavior
In
wire/core/Modules/ModulesFlags.php:setFlags()calculatesflagsClifrom$info['cli']only during install/refresh.flagsCliunset.findByFlag(flagsCli)returns nothing, sogetCliModules()falls back to module-name lookup. Explicitphp index.php SomeModulecalls work; the help listing silently omits pre-existing CLI modules.Optional: Suggestion for a possible fix
Either:
flagsCliis missing from the flag schema.Setup/Environment
dev@15c749edwire/core/Modules/ModulesFlags.php