mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:29 +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
74cc2f03ff
commit
12a77b2126
@ -387,18 +387,16 @@ class importexport_export_csv implements importexport_iface_export_record
|
||||
$record->$name = '';
|
||||
}
|
||||
}
|
||||
foreach($fields['select-account'] ?? [] as $name) {
|
||||
foreach($fields['select-account'] ?? [] as $name)
|
||||
{
|
||||
// Compare against null to deal with empty arrays
|
||||
if ($record->$name !== null) {
|
||||
if(is_array($record->$name)) {
|
||||
$names = array();
|
||||
foreach($record->$name as $_name) {
|
||||
$names[] = Api\Accounts::username($_name);
|
||||
}
|
||||
$record->$name = implode(', ', $names);
|
||||
} else {
|
||||
$record->$name = Api\Accounts::username($record->$name);
|
||||
if ($record->$name !== null)
|
||||
{
|
||||
$names = array();
|
||||
foreach((array)$record->$name as $_name) {
|
||||
$names[] = Api\Accounts::title((int)$_name ?: $_name);
|
||||
}
|
||||
$record->$name = implode(', ', $names);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user