mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 08:19:09 +01:00
fix PHP 8.0 TypeError: Api\Accounts::username(): Argument #1 ($account_id) must be of type ?int, string given
using Api\Accounts::title() but cast to int, if giving an non-zero result
This commit is contained in:
parent
fa67fc24d7
commit
a125be6074
@ -387,18 +387,16 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
$record->$name = '';
|
$record->$name = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($fields['select-account'] ?? [] as $name) {
|
foreach($fields['select-account'] ?? [] as $name)
|
||||||
|
{
|
||||||
// Compare against null to deal with empty arrays
|
// Compare against null to deal with empty arrays
|
||||||
if ($record->$name !== null) {
|
if ($record->$name !== null)
|
||||||
if(is_array($record->$name)) {
|
{
|
||||||
$names = array();
|
$names = array();
|
||||||
foreach($record->$name as $_name) {
|
foreach((array)$record->$name as $_name) {
|
||||||
$names[] = Api\Accounts::username($_name);
|
$names[] = Api\Accounts::title((int)$_name ?: $_name);
|
||||||
}
|
|
||||||
$record->$name = implode(', ', $names);
|
|
||||||
} else {
|
|
||||||
$record->$name = Api\Accounts::username($record->$name);
|
|
||||||
}
|
}
|
||||||
|
$record->$name = implode(', ', $names);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user