Skip to content

Commit

Permalink
Use getCurrentDocument function
Browse files Browse the repository at this point in the history
Class Doc was renamed to AbstractDocument and function getDoc was renamed to getCurrentDocument
  • Loading branch information
beatrycze-volk committed Sep 27, 2023
1 parent 049e1a7 commit 92df8fd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Classes/ViewHelpers/XpathViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ public static function renderStatic(

$document = self::getDocumentRepository()->findOneByParameters($parameters);

if ($document === null || $document->getDoc() === null || !($document->getDoc() instanceof MetsDocument)) {
if ($document === null || $document->getCurrentDocument() === null || !($document->getCurrentDocument() instanceof MetsDocument)) {
return;
}
$currentDocument = $document->getCurrentDocument();
$currentDocument->mets->registerXPathNamespace('mets', 'http://www.loc.gov/METS/');
$currentDocument->mets->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');
$currentDocument->mets->registerXPathNamespace('dv', 'http://dfg-viewer.de/');
$currentDocument->mets->registerXPathNamespace('slub', 'http://slub-dresden.de/');

$document->getDoc()->mets->registerXPathNamespace('mets', 'http://www.loc.gov/METS/');
$document->getDoc()->mets->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');
$document->getDoc()->mets->registerXPathNamespace('dv', 'http://dfg-viewer.de/');
$document->getDoc()->mets->registerXPathNamespace('slub', 'http://slub-dresden.de/');

$result = $document->getDoc()->mets->xpath($xpath);
$result = $currentDocument->mets->xpath($xpath);

if (is_array($result)) {
foreach ($result as $row) {
Expand Down

0 comments on commit 92df8fd

Please sign in to comment.