From 92df8fd2eff278623e0cf63dd4c58d3ce681c9fa Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Wed, 27 Sep 2023 17:05:16 +0200 Subject: [PATCH] Use getCurrentDocument function Class Doc was renamed to AbstractDocument and function getDoc was renamed to getCurrentDocument --- Classes/ViewHelpers/XpathViewHelper.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Classes/ViewHelpers/XpathViewHelper.php b/Classes/ViewHelpers/XpathViewHelper.php index df26ff5..e0c768f 100644 --- a/Classes/ViewHelpers/XpathViewHelper.php +++ b/Classes/ViewHelpers/XpathViewHelper.php @@ -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) {