nixos-module: work around upstream language-list caching bug

Migration 2025_08_31_224356_additional_languages_af_ca_id.php runs
during `migrate`, before db:seed's LanguageSeeder has populated the
other 42 rows of the languages table, and does
Cache::forever('languages', Language::all()) - permanently caching
just the 3 languages (Afrikaans, Catalan, Indonesian) it sees at that
moment. StaticServiceProvider checks this cache key before ever
querying the DB again, so every fresh install's language dropdown
(e.g. the "Welcome to Invoice Ninja" company setup wizard) was stuck
showing only those 3 entries, in their own native-language spelling
(ctrans() translates each name using the active locale).

Adds an unconditional `invoiceninja-manage cache:forget languages` to
invoiceninja-data-setup.service, and a regression test asserting
/api/v1/statics returns more than 40 languages. Verified directly:
before the fix, a fresh account's statics call returned exactly 3
languages; after, it returns all 45.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 15:17:22 -04:00
co-authored by Claude Sonnet 5
parent d7fea37e25
commit 7d7d717745
3 changed files with 30 additions and 1 deletions
+8
View File
@@ -696,6 +696,14 @@ in
# Necessary for languages, currencies, countries, etc.
[[ ! -f ${cfg.dataDir}/.db-seeded ]] && invoiceninja-manage db:seed --force && touch ${cfg.dataDir}/.db-seeded
# Work around an upstream bug: migration 2025_08_31_224356_additional_languages_af_ca_id.php
# runs during `migrate` (before db:seed's LanguageSeeder has populated the other 42 rows) and
# does `Cache::forever('languages', Language::all())`, permanently caching just the 3 languages
# it sees at that moment. Without this, the language list stays stuck at those 3 forever,
# since StaticServiceProvider checks this cache key before ever querying the DB again.
# Unconditional (not marker-gated) so it also self-heals installs that hit this before the fix.
invoiceninja-manage cache:forget languages
# Create Invoice Ninja admin account
[[ (! -f ${cfg.dataDir}/.admin-created) && (${
if cfg.adminAccount.enable then "true" else "false"