From 8f8a3acba7554ac476148f7a954fa1abf9771088 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sun, 3 Dec 2023 23:28:19 +0100 Subject: [PATCH] Fixed DSONameService getName & getHitHighlights returning empty string for OrgUnits without organization.legalName field (cherry picked from commit e96d3cd2e9f799dc46f827af6d7d7bf587b68eee) --- src/app/core/breadcrumbs/dso-name.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/core/breadcrumbs/dso-name.service.ts b/src/app/core/breadcrumbs/dso-name.service.ts index ddd97705b0..8e4fb771c6 100644 --- a/src/app/core/breadcrumbs/dso-name.service.ts +++ b/src/app/core/breadcrumbs/dso-name.service.ts @@ -50,7 +50,7 @@ export class DSONameService { } }, OrgUnit: (dso: DSpaceObject): string => { - return dso.firstMetadataValue('organization.legalName'); + return dso.firstMetadataValue('organization.legalName') || this.translateService.instant('dso.name.untitled'); }, Default: (dso: DSpaceObject): string => { // If object doesn't have dc.title metadata use name property @@ -106,7 +106,7 @@ export class DSONameService { } return `${familyName}, ${givenName}`; } else if (entityType === 'OrgUnit') { - return this.firstMetadataValue(object, dso, 'organization.legalName'); + return this.firstMetadataValue(object, dso, 'organization.legalName') || this.translateService.instant('dso.name.untitled'); } return this.firstMetadataValue(object, dso, 'dc.title') || dso.name || this.translateService.instant('dso.name.untitled'); }