Skip to content

Commit

Permalink
Fixed DSONameService getName & getHitHighlights returning empty strin…
Browse files Browse the repository at this point in the history
…g for OrgUnits without organization.legalName field
  • Loading branch information
alexandrevryghem committed Dec 3, 2023
1 parent 4f6314a commit c4ac4f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/core/breadcrumbs/dso-name.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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');
}
Expand Down

0 comments on commit c4ac4f2

Please sign in to comment.