mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +02:00
Dont concat if one of the strings is empty during part merge
This commit is contained in:
parent
36879dd7da
commit
b9956e38b8
2 changed files with 29 additions and 0 deletions
|
@ -319,6 +319,14 @@ trait EntityMergerHelperTrait
|
|||
return $t;
|
||||
}
|
||||
|
||||
//Skip empty strings
|
||||
if (trim($t) === '') {
|
||||
return trim($o);
|
||||
}
|
||||
if (trim($o) === '') {
|
||||
return trim($t);
|
||||
}
|
||||
|
||||
return trim($t) . $separator . trim($o);
|
||||
},
|
||||
$target,
|
||||
|
@ -344,6 +352,14 @@ trait EntityMergerHelperTrait
|
|||
return $t;
|
||||
}
|
||||
|
||||
//Skip empty strings
|
||||
if (trim($t) === '') {
|
||||
return trim($o);
|
||||
}
|
||||
if (trim($o) === '') {
|
||||
return trim($t);
|
||||
}
|
||||
|
||||
return sprintf("%s\n\n<b>%s:</b>\n%s",
|
||||
trim($t),
|
||||
$other->getName(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue