Fixed issue with filepicker field where images wouldn't properly merge with the current value if in a page header

This commit is contained in:
Djamil Legato
2018-05-23 10:24:22 -07:00
parent 2352ba6c7c
commit b9e00b7720
2 changed files with 3 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
1. [](#bugfix)
* Check if `$object->blueprints()` exists in `onAdminAfterSave`
* Fix admin login redirects for multisite setups
* Fixed issue with filepicker field where images wouldn't properly merge with the current value if in a page header
# v1.8.1
## 05/15/2018

View File

@@ -719,9 +719,9 @@ class AdminBaseController
} else {
$new_data = $files;
}
if (isset($data['header'][$init_key])) {
if ($obj->header()->{$init_key}) {
$obj->modifyHeader($init_key,
array_replace_recursive([], $data['header'][$init_key], $new_data));
array_replace_recursive([], $obj->header()->{$init_key}, $new_data));
} else {
$obj->modifyHeader($init_key, $new_data);
}