mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-12-22 00:10:34 +01:00
Fix for deleting user avatar (regular users)
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
1. [](#bugfix)
|
1. [](#bugfix)
|
||||||
* Fixed missing language for AJAX requests
|
* Fixed missing language for AJAX requests
|
||||||
* Fixed redirect with absolute language URL
|
* Fixed redirect with absolute language URL
|
||||||
|
* Fixed issue with user avatar reference not being deleted when image removed
|
||||||
|
|
||||||
# v1.10.0-beta.7
|
# v1.10.0-beta.7
|
||||||
## 08/30/2019
|
## 08/30/2019
|
||||||
|
|||||||
@@ -971,10 +971,10 @@ class AdminBaseController
|
|||||||
$this->taskRemoveMedia($destination . '/' . $filename);
|
$this->taskRemoveMedia($destination . '/' . $filename);
|
||||||
|
|
||||||
if ($page) {
|
if ($page) {
|
||||||
$keys = explode('.', preg_replace('/^header./', '', $field));
|
$keys = explode('.', preg_replace('/^header./', '', $field));
|
||||||
$header = (array)$page->header();
|
$header = (array)$page->header();
|
||||||
$data_path = implode('.', $keys);
|
$data_path = implode('.', $keys);
|
||||||
$data = Utils::getDotNotation($header, $data_path);
|
$data = Utils::getDotNotation($header, $data_path);
|
||||||
|
|
||||||
if (isset($data[$path])) {
|
if (isset($data[$path])) {
|
||||||
unset($data[$path]);
|
unset($data[$path]);
|
||||||
@@ -983,6 +983,10 @@ class AdminBaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$page->save();
|
$page->save();
|
||||||
|
} elseif ($type === 'user') {
|
||||||
|
$user = Grav::instance()['user'];
|
||||||
|
unset($user->avatar);
|
||||||
|
$user->save();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$blueprint_prefix = $type === 'config' ? '' : $type . '.';
|
$blueprint_prefix = $type === 'config' ? '' : $type . '.';
|
||||||
|
|||||||
Reference in New Issue
Block a user