Skip to content

[6.x] Make Composer::isInstalled() fail gracefully when the lock file is missing - #15333

Merged
jasonvarga merged 1 commit into
6.xfrom
graceful-is-installed
Sep 1, 2026
Merged

[6.x] Make Composer::isInstalled() fail gracefully when the lock file is missing#15333
jasonvarga merged 1 commit into
6.xfrom
graceful-is-installed

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where Composer::isInstalled() throws a ComposerLockFileNotFoundException when the composer.lock file doesn't exist.

This was happening because it reads the lock file without checking it exists first, unlike Composer::installed() and Composer::installedVersion(), which already fail gracefully when the lock file is missing.

This PR fixes it by returning false when there's no lock file, since we can't know whether a package is installed without one. This is mostly an issue in addon test suites, where the Testbench skeleton doesn't include a composer.lock file, forcing addons to create a stub lock file whenever something in core calls Composer::isInstalled(). With the Forms 2 changes, that'll happen on every front-end form request via Statamic::formsProInstalled().

@jasonvarga
jasonvarga merged commit 1a5a920 into 6.x Sep 1, 2026
65 checks passed
@jasonvarga
jasonvarga deleted the graceful-is-installed branch September 1, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants