diff --git a/module/Finna/src/Finna/RecordDriver/SolrEad3.php b/module/Finna/src/Finna/RecordDriver/SolrEad3.php index e590b813ce0..de9e0dd7e99 100644 --- a/module/Finna/src/Finna/RecordDriver/SolrEad3.php +++ b/module/Finna/src/Finna/RecordDriver/SolrEad3.php @@ -1138,8 +1138,8 @@ public function getPhysicalDescriptions() if (!isset($xml->did)) { return []; } - $results = $this->getDisplayLabel($xml->did, 'physdesc'); - $localeResults = $this->getDisplayLabel($xml->did, 'physdesc', true); + $results = $localeResults = []; + // Check structured physical descriptions first foreach ($xml->did->physdescstructured ?? [] as $desc) { $lang = $this->detectNodeLanguage($desc); $quantity = trim((string)($desc->quantity ?? '')); @@ -1151,8 +1151,8 @@ public function getPhysicalDescriptions() } } } - - return $localeResults ?: $results; + // If no structured descriptions were found, use unstructured descriptions + return $localeResults ?: $results ?: $this->getDisplayLabel($xml->did, 'physdesc'); } /**