Fixed new Flex User erroring out on save (thanks @mikebi42)

This commit is contained in:
Matias Griese
2020-05-25 22:18:30 +03:00
parent a156247dc3
commit 96d11e4ffa
2 changed files with 2 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
* Changed `Folder::hasChildren` to `Folder::countChildren`
1. [](#bugfix)
* Fixed new `Flex Page` not having correct form fields for the page type
* Fixed new `Flex User` erroring out on save (thanks @mikebi42)
* Fixed blueprint value filtering in lists [#2923](https://github.com/getgrav/grav/issues/2923)
# v1.7.0-rc.11

View File

@@ -57,7 +57,7 @@ class UserIndex extends FlexIndex
public static function updateObjectMeta(array &$meta, array $data)
{
// Username can also be number and stored as such.
$key = (string)($data['username'] ?? $meta['key']);
$key = (string)($data['username'] ?? $meta['key'] ?? $meta['storage_key']);
$meta['key'] = mb_strtolower($key);
$meta['email'] = isset($data['email']) ? mb_strtolower($data['email']) : null;
}