mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Fixed DSONameService getName & getHitHighlights returning empty string for OrgUnits without organization.legalName field
(cherry picked from commit e96d3cd2e9
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
dbb7917058
commit
8f8a3acba7
@@ -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');
|
||||
}
|
||||
|
Reference in New Issue
Block a user