Upgrade to 3.1.3

This commit is contained in:
Bastian Allgeier
2019-04-23 16:13:26 +02:00
parent eb29ef6d6c
commit 066913cb6e
53 changed files with 606 additions and 261 deletions

View File

@@ -21,7 +21,8 @@ class Form extends BaseForm
if ($kirby->multilang() === true) {
$fields = $props['fields'] ?? [];
$isDefaultLanguage = $kirby->language()->isDefault();
$languageCode = $props['language'] ?? $kirby->language()->code();
$isDefaultLanguage = $languageCode === $kirby->defaultLanguage()->code();
foreach ($fields as $fieldName => $fieldProps) {
// switch untranslatable fields to readonly
@@ -40,7 +41,7 @@ class Form extends BaseForm
public static function for(Model $model, array $props = [])
{
// get the original model data
$original = $model->content()->toArray();
$original = $model->content($props['language'] ?? null)->toArray();
$values = $props['values'] ?? [];
// convert closures to values