allow reasons not inside a category

This commit is contained in:
Mathieu Jaumotte 2021-02-09 19:18:29 +01:00
parent cd054fe6ef
commit f4a76f659e

View File

@ -70,10 +70,14 @@ class ActivityReasonRender extends AbstractChillEntityRender
*/
public function renderString($entity, array $options): string
{
return $this->translatableStringHelper->localize(
$entity->getCategory()->getName()
).
' > '.
$category = '';
if (null !== $entity->getCategory()) {
$category = $this->translatableStringHelper->localize(
$entity->getCategory()->getName()). ' > ';
}
return $category .
$this->translatableStringHelper->localize(
$entity->getName()
);