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