diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php index 47dca30407..916818e737 100644 --- a/lib/Service/FileService.php +++ b/lib/Service/FileService.php @@ -275,6 +275,9 @@ private function getPages(): array { */ private function getVisibleElements(): array { $return = []; + if (!$this->showVisibleElements) { + return $return; + } try { if (is_object($this->signRequest)) { $visibleElements = $this->fileElementMapper->getByFileIdAndSignRequestId($this->file->getId(), $this->signRequest->getId()); @@ -380,9 +383,7 @@ private function getFile(): array { if ($this->showSigners) { $return['signers'] = $this->getSigners(); } - if ($this->showVisibleElements) { - $return['visibleElements'] = $this->getVisibleElements(); - } + $return['visibleElements'] = $this->getVisibleElements(); ksort($return); return $return; }