Fix: Skip template rendering when no document is loaded
For example, this makes sure that the "No volume selected" message in `slub_digitalcollections` keeps working.
This commit is contained in:
parent
e6dbc09649
commit
1a27044368
|
@ -82,7 +82,7 @@ class AudioplayerController extends AbstractController
|
|||
|| $this->document->getDoc()->numPages < 1
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
} else {
|
||||
// Set default values if not set.
|
||||
// $this->requestData['page'] may be integer or string (physical structure @ID)
|
||||
|
@ -111,7 +111,7 @@ class AudioplayerController extends AbstractController
|
|||
$this->addPlayerJS();
|
||||
} else {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class CalendarController extends AbstractController
|
|||
$this->loadDocument($this->requestData);
|
||||
if ($this->document === null) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
|
||||
$metadata = $this->document->getDoc()->getTitledata();
|
||||
|
@ -112,7 +112,7 @@ class CalendarController extends AbstractController
|
|||
$this->loadDocument($this->requestData);
|
||||
if ($this->document === null) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
|
||||
$documents = $this->documentRepository->getChildrenOfYearAnchor($this->document->getUid(), $this->structureRepository->findOneByIndexName('issue'));
|
||||
|
@ -216,7 +216,7 @@ class CalendarController extends AbstractController
|
|||
$this->loadDocument($this->requestData);
|
||||
if ($this->document === null) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
|
||||
// Get all children of anchor. This should be the year anchor documents
|
||||
|
|
|
@ -39,7 +39,7 @@ class NavigationController extends AbstractController
|
|||
|| $this->document->getDoc() === null
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
} else {
|
||||
// Set default values if not set.
|
||||
if ($this->document->getDoc()->numPages > 0) {
|
||||
|
|
|
@ -38,7 +38,7 @@ class PageGridController extends AbstractController
|
|||
|| empty($this->extConf['fileGrpThumbs'])
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
|
||||
$entryArray = [];
|
||||
|
|
|
@ -74,7 +74,7 @@ class PageViewController extends AbstractController
|
|||
|| $this->document->getDoc()->numPages < 1
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
} else {
|
||||
if (!empty($this->requestData['logicalPage'])) {
|
||||
$this->requestData['page'] = $this->document->getDoc()->getPhysicalPage($this->requestData['logicalPage']);
|
||||
|
|
|
@ -93,7 +93,7 @@ class SearchController extends AbstractController
|
|||
// Quit without doing anything if required variables are not set.
|
||||
if (empty($this->settings['solrcore'])) {
|
||||
$this->logger->warning('Incomplete plugin configuration');
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
|
||||
// if search was triggered, get search parameters from POST variables
|
||||
|
|
|
@ -59,7 +59,7 @@ class ToolboxController extends AbstractController
|
|||
|| $this->document->getDoc()->numPages < 1
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
} else {
|
||||
if (!empty($this->requestData['logicalPage'])) {
|
||||
$this->requestData['page'] = $this->document->getDoc()->getPhysicalPage($this->requestData['logicalPage']);
|
||||
|
@ -102,7 +102,7 @@ class ToolboxController extends AbstractController
|
|||
|| empty($this->extConf['fileGrpFulltext'])
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
} else {
|
||||
if (!empty($this->requestData['logicalPage'])) {
|
||||
$this->requestData['page'] = $this->document->getDoc()->getPhysicalPage($this->requestData['logicalPage']);
|
||||
|
@ -148,7 +148,7 @@ class ToolboxController extends AbstractController
|
|||
|| empty($this->extConf['fileGrpFulltext'])
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
} else {
|
||||
if (!empty($this->requestData['logicalPage'])) {
|
||||
$this->requestData['page'] = $this->document->getDoc()->getPhysicalPage($this->requestData['logicalPage']);
|
||||
|
@ -194,7 +194,7 @@ class ToolboxController extends AbstractController
|
|||
|| empty($this->settings['fileGrpsImageDownload'])
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
} else {
|
||||
if (!empty($this->requestData['logicalPage'])) {
|
||||
$this->requestData['page'] = $this->document->getDoc()->getPhysicalPage($this->requestData['logicalPage']);
|
||||
|
@ -287,7 +287,7 @@ class ToolboxController extends AbstractController
|
|||
|| empty($this->extConf['fileGrpDownload'])
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
} else {
|
||||
if (!empty($this->requestData['logicalPage'])) {
|
||||
$this->requestData['page'] = $this->document->getDoc()->getPhysicalPage($this->requestData['logicalPage']);
|
||||
|
@ -402,7 +402,7 @@ class ToolboxController extends AbstractController
|
|||
|| empty($this->settings['solrcore'])
|
||||
) {
|
||||
// Quit without doing anything if required variables are not set.
|
||||
return;
|
||||
return '';
|
||||
} else {
|
||||
if (!empty($this->requestData['logicalPage'])) {
|
||||
$this->requestData['page'] = $this->document->getDoc()->getPhysicalPage($this->requestData['logicalPage']);
|
||||
|
|
Loading…
Reference in New Issue