Register config fields without enumerating forms - #10
Merged
Conversation
With statamic/eloquent-driver installed, enumerating forms in bootAddon() queried the database on every boot, so the application failed to start whenever that database was unreachable or not yet migrated (package:discover, Larastan analysis, first deploy). The MailerLite section is now registered once with the '*' wildcard, removing all database access from boot. The per-form field options in the mapping grid move to a new mailer_lite_form_fields fieldtype that resolves the form from the CP route while the configure page renders. Changelog: fixed
jhhazelaar
force-pushed
the
b/jh/tolerate-missing-database-at-boot
branch
from
July 13, 2026 17:08
0e1bfe6 to
3a5a82b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
statamic/eloquent-driverinstalled,bootAddon()queried the database viaForm::all()on every application boot. When that database is unreachable or not yet migrated, the whole application fails to boot — which breakspackage:discover, Larastan/PHPStan analysis in CI, and first deploys.Seen in campus-coalitie CI (phpstan job): MR 405 pipeline
Fix
Follows the same pattern as statamic-rad-pack/mailchimp:
'*'wildcard (supported byFormRepository::extraConfigFor()), so boot no longer touches the forms repository at all — no database access, and one query per request less.mailer_lite_form_fieldsfieldtype. Itspreload()resolves the form from the CP route while the configure page renders and feeds the blueprint fields to a searchableComboboxvia meta. Unlike the rad-pack version this needs no extra CP route/XHR and no client-side URL parsing.Includes regression tests: boot never calls
Form::all(), wildcard section registration, and fieldtype option preloading.