Skip to content

Conversation

@sebastian-meyer
Copy link

VuFind 10 erfordert PHP 8.1+. Seit Version 8 erlaubt PHP keine Zugriffe mehr auf unbelegte Array-Keys und das dynamische Generieren von Objekt-Properties muss von Klassen explizit erlaubt werden. Dies erfordert einige Anpassungen am RecordDriver, die von diesem Pull-Request bereitgestellt werden.

Die Entwicklung fand im Rahmen eines Projekt an der HAAB Weimar statt. Dort läuft VuFind 10 mit diesem Modul produktiv: https://portal.haab.klassik-stiftung.de

Copy link
Author

@sebastian-meyer sebastian-meyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ein paar Kommentare zur Erläuterung:

Comment on lines -214 to -215
} elseif ($subField == 'description') {
$descriptions[] = $subFieldSpec;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier werden zwar $descriptions gesammelt, diese werden aber nie in $solrMarcSpecs[$item][$marcField]['description'] gespeichert (und auch im Template nicht erwartet). Der Code wurde hier deshalb entfernt.

Comment on lines -550 to -591
/**
* Return an XML representation of the record using the specified format.
* Return false if the format is unsupported.
*
* @param string $format Name of format to use (corresponds with OAI-PMH
* metadataPrefix parameter).
* @param string $baseUrl Base URL of host containing VuFind (optional;
* may be used to inject record URLs into XML when appropriate).
* @param RecordLink $recordLink Record link helper (optional; may be used to
* inject record URLs into XML when appropriate).
*
* @return mixed XML, or false if format unsupported.
*/
public function getXML($format, $baseUrl = null, $recordLink = null)
{
// Special case for MARC:
if ($format == 'marc21') {
$xml = $this->getMarcReader()->toXML();
$xml = str_replace(
[chr(27), chr(28), chr(29), chr(30), chr(31)], ' ', $xml
);
$xml = simplexml_load_string($xml);
if (!$xml || !isset($xml->record)) {
return false;
}

// Set up proper namespacing and extract just the <record> tag:
$xml->record->addAttribute('xmlns', "http://www.loc.gov/MARC21/slim");
$xml->record->addAttribute(
'xsi:schemaLocation',
'http://www.loc.gov/MARC21/slim ' .
'http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd',
'http://www.w3.org/2001/XMLSchema-instance'
);
$xml->record->addAttribute('type', 'Bibliographic');
return $xml->record->asXML();
}

// Try the parent method:
return parent::getXML($format, $baseUrl, $recordLink);
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diese Funktion ist nicht mehr kompatibel mit der Basis-Funktion in \VuFind\RecordDriver\Feature\MarcAdvancedTrait, enthält aber auch keine notwendigen Anpassungen gegenüber dieser. Sie wurde deshalb entfernt. Die Funktionalität ist durch oben genannten Trait weiterhin gegeben.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant