Skip to content

Fix: Make m230401_174208_add_allow_jwt_auth migration resilient when module is not bootstrapped#242

Merged
luke- merged 1 commit into
masterfrom
fix/migration-no-module-autoload
Jun 16, 2026
Merged

Fix: Make m230401_174208_add_allow_jwt_auth migration resilient when module is not bootstrapped#242
luke- merged 1 commit into
masterfrom
fix/migration-no-module-autoload

Conversation

@luke-

@luke- luke- commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace Yii::$app->getModule('rest')->settings calls with direct setting table queries — the module may not be registered during migrate/up (core #[WithoutModuleAutoload] skips third-party module bootstrap)
  • Use upsert() for writing settings, making the migration naturally idempotent

Test plan

  • Run migrate/up on an instance where rest was previously installed — migration should complete without errors
  • Run migrate/up a second time — upsert makes it idempotent, should skip cleanly
  • Verify enableJwtAuth is set correctly based on whether jwtKey was previously configured

@luke- luke- merged commit cc0d8e8 into master Jun 16, 2026
12 checks passed
@luke- luke- deleted the fix/migration-no-module-autoload branch June 16, 2026 14:05
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.

1 participant