File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/RecordManager/Base/Record Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,13 @@ class Lido extends AbstractRecord
115115 */
116116 protected $ subjectConceptIDTypes = ['uri ' , 'url ' ];
117117
118+ /**
119+ * Title types for preferred titles.
120+ *
121+ * @var array
122+ */
123+ protected $ preferredTitleTypes = ['preferred ' ];
124+
118125 /**
119126 * Repository location types to be included.
120127 *
@@ -486,13 +493,13 @@ protected function getTitles()
486493 if (!($ title = trim ((string )$ appellationValue ))) {
487494 continue ;
488495 }
489- $ preference = ( string )$ appellationValue[ ' pref ' ] ?: 'preferred ' ;
496+ $ preference = mb_strtolower (( string )( $ appellationValue-> attributes ()-> pref ?? 'preferred ' ), ' UTF-8 ' ) ;
490497 $ titleLang = $ this ->getInheritedXmlAttribute (
491498 $ appellationValue ,
492499 'lang ' ,
493500 $ defaultLanguage
494501 );
495- if (' preferred ' === $ preference ) {
502+ if (in_array ( $ preference, $ this -> preferredTitleTypes ) ) {
496503 $ preferredParts [$ titleLang ][] = $ title ;
497504 } else {
498505 $ alternateParts [$ titleLang ][] = $ title ;
@@ -1341,7 +1348,7 @@ protected function getRepositoryLocations(): array
13411348 $ this ->doc ->lido ->descriptiveMetadata ->objectIdentificationWrap ->repositoryWrap ->repositorySet
13421349 ?? [] as $ set
13431350 ) {
1344- $ type = ( string )($ set ->attributes ()->type ?? '' );
1351+ $ type = mb_strtolower (( string )($ set ->attributes ()->type ?? '' ), ' UTF-8 ' );
13451352 if ($ this ->repositoryLocationTypes && !in_array ($ type , $ this ->repositoryLocationTypes )) {
13461353 continue ;
13471354 }
You can’t perform that action at this time.
0 commit comments