Skip to content

Commit

Permalink
Uploaded Avatar removed from user's yaml when editing the user [#1647]
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Apr 15, 2019
1 parent 2358919 commit 4fa59f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions classes/adminbasecontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,8 @@ protected function storeFiles($obj)
} 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
Expand Down
1 change: 0 additions & 1 deletion classes/admincontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ protected function taskSaveUser()
}

$user->update($data->toArray());
$user->undef('avatar');

$user = $this->storeFiles($user);

Expand Down

0 comments on commit 4fa59f1

Please sign in to comment.