fix: force default language on contactDatabase write to prevent silent drop in EN context
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 24s

Kirby's Form system strips translate:false fields when the current language
is not the default, so update() in an EN request silently discarded the
contactDatabase payload. Explicitly passing the default language code ensures
the write always targets white-papers.fr.txt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-06-01 16:58:45 +02:00
parent effe6ec547
commit 7ceb07f2b0

View file

@ -90,8 +90,12 @@ return [
];
}
kirby()->impersonate('kirby', function () use ($page, $entries) {
page('livres-blancs')->update(['contactDatabase' => \Kirby\Data\Data::encode($entries, 'yaml')]);
$defaultLang = kirby()->defaultLanguage()->code();
kirby()->impersonate('kirby', function () use ($entries, $defaultLang) {
page('livres-blancs')->update(
['contactDatabase' => \Kirby\Data\Data::encode($entries, 'yaml')],
$defaultLang
);
});
header('Content-Type: application/json');