From 6022f21e554d4decef23e1fadd256498c69d32c5 Mon Sep 17 00:00:00 2001 From: Andreas Fernandez Date: Fri, 15 Feb 2019 17:15:22 +0100 Subject: [PATCH] [BUGFIX] EXT:opendocs - Remove bogus initial document count When the opendocs toolbar item gets initialized, the document count shows a bogus value as deleted records are not removed from the calculation. As the documents are loaded deferred since #84412, the correct value gets in place automatically which renders the initial counting obsolete and is removed with this patch. Additonally, a wrong class hint in OpenDocumentController is fixed. Resolves: #87725 Related: #84412 Releases: master, 9.5 Change-Id: I0684e0950d0f4daf11042d6c078b5598bfb3d4be Reviewed-on: https://review.typo3.org/59710 Tested-by: TYPO3com Reviewed-by: Anja Leichsenring Tested-by: Anja Leichsenring --- .../Classes/Backend/ToolbarItems/OpendocsToolbarItem.php | 1 - .../opendocs/Classes/Controller/OpenDocumentController.php | 3 +-- .../Resources/Private/Templates/ToolbarItems/ToolbarItem.html | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php b/typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php index 5121f9d70a51..219da913df99 100644 --- a/typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php +++ b/typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php @@ -67,7 +67,6 @@ public function checkAccess(): bool public function getItem() { $view = $this->getFluidTemplateObject('ToolbarItem.html'); - $view->assign('numDocs', count($this->documentService->getOpenDocuments())); return $view->render(); } diff --git a/typo3/sysext/opendocs/Classes/Controller/OpenDocumentController.php b/typo3/sysext/opendocs/Classes/Controller/OpenDocumentController.php index f14ad80df9ef..9eb8665bc12d 100644 --- a/typo3/sysext/opendocs/Classes/Controller/OpenDocumentController.php +++ b/typo3/sysext/opendocs/Classes/Controller/OpenDocumentController.php @@ -17,7 +17,6 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; -use TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem; use TYPO3\CMS\Core\Http\HtmlResponse; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Opendocs\Backend\ToolbarItems\OpendocsToolbarItem; @@ -37,7 +36,7 @@ class OpenDocumentController protected $documents; /** - * @var SystemInformationToolbarItem + * @var OpendocsToolbarItem */ protected $toolbarItem; diff --git a/typo3/sysext/opendocs/Resources/Private/Templates/ToolbarItems/ToolbarItem.html b/typo3/sysext/opendocs/Resources/Private/Templates/ToolbarItems/ToolbarItem.html index db780293171c..068baffc42db 100644 --- a/typo3/sysext/opendocs/Resources/Private/Templates/ToolbarItems/ToolbarItem.html +++ b/typo3/sysext/opendocs/Resources/Private/Templates/ToolbarItems/ToolbarItem.html @@ -3,5 +3,5 @@ {f:translate(key: 'toolbaritem', extensionName: 'opendocs')} -{numDocs} +