Uploaded Avatar removed from user's yaml when editing the user [#1647]

This commit is contained in:
Matias Griese
2019-04-15 11:27:39 +03:00
parent 2358919d10
commit 4fa59f18e8
3 changed files with 3 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
1. [](#bugfix)
* Fix for homepage admin preview [#2426](https://github.com/getgrav/grav/issues/2426)
* Uploaded Avatar removed from user's yaml when editing the user [#1647](https://github.com/getgrav/grav-plugin-admin/issues/1647)
# v1.9.1
## 04/13/2019

View File

@@ -764,6 +764,8 @@ class AdminBaseController
} else {
$obj->modifyHeader($init_key, $new_data);
}
} elseif ($obj instanceof UserInterface and $key === 'avatar') {
$obj->set($key, $files);
} else {
// TODO: [this is JS handled] if it's single file, remove existing and use set, if it's multiple, use join
$obj->join($key, $files); // stores

View File

@@ -708,7 +708,6 @@ class AdminController extends AdminBaseController
}
$user->update($data->toArray());
$user->undef('avatar');
$user = $this->storeFiles($user);