Closed mheuschneider closed 2 years ago
I've tracked down and found that this is related with following line: https://github.com/getkirby/kirby/blob/3.6.2/src/Cms/ModelWithContent.php#L600-L604
You can simply test with following code:
$page = page('sandbox');
$form = Form::for($page, [
'ignoreDisabled' => false,
'input' => [],
'language' => 'de', // secondary language code
]);
var_dump($form->data());
When the select field is query, its value returns empty.
Model's language data is not processed when pulling/handling query options.
This issue applies to all fields that use options
mixin.
https://github.com/getkirby/kirby/blob/3.6.2/config/fields/mixins/options.php#L32-L46
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Description
When using
$page->update([], 'de')
, the content should not change. But if I try the same with 'en' (second language) all select fields with a query are reseted.The query for this select field is following: site.magazin_categories.split
Im using this function inside the
page.changeSlug:after
hook.Expected behavior
The same as in the default language.
Screenshots
Screenshots after hook
de.txt
en.txt
To reproduce
Kirby::plugin('my/customhook', [ 'hooks' => [ 'page.changeSlug:after' => function ($newPage, $oldPage) { $site = site();
]);
Your setup
Kirby Version
Tested with 3.6.1.1 and 3.6.2
Your system