Closed clarkwinkelmann closed 5 years ago
I am not 100% sure but it seems that the issue is here:
fof/user-directory/src/Content/UserDirectory.php on line 65
'sort' => array_get($this->sortMap, $sort, ''),
when $sort is NULL eg you open /users and there is no sort parameter, the array_get returns the whole array of sortMap and not the default value
I have fixed this by adding default value to $sort variable if it is missing on line 60
$sort = array_pull($queryParams, 'sort'); <- old line
$sort = array_pull($queryParams, 'sort') ?? 'username'; <- new line
@stream0 thank you very much, this was indeed the issue :+1:
If PHP Warnings are not hidden, the following appears when accessing
/users
directly:No idea if we're doing something wrong in User Directory, or if it's an issue in the JSON API library...
If someone has time to dig into the root cause, all help is welcome :smile:
The workaround is to hide the PHP Warnings in the page output, as it should be on production anyway.