[BUGFIX] EXT:opendocs - Remove bogus initial document count 08/59708/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 15 Feb 2019 16:15:22 +0000 (17:15 +0100)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Sat, 16 Feb 2019 09:12:40 +0000 (10:12 +0100)
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/59708
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Björn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php
typo3/sysext/opendocs/Classes/Controller/OpenDocumentController.php
typo3/sysext/opendocs/Resources/Private/Templates/ToolbarItems/ToolbarItem.html

index 5121f9d..219da91 100644 (file)
@@ -67,7 +67,6 @@ class OpendocsToolbarItem implements ToolbarItemInterface
     public function getItem()
     {
         $view = $this->getFluidTemplateObject('ToolbarItem.html');
-        $view->assign('numDocs', count($this->documentService->getOpenDocuments()));
 
         return $view->render();
     }
index f14ad80..9eb8665 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Opendocs\Controller;
 
 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;
 
index db78029..068baff 100644 (file)
@@ -3,5 +3,5 @@
        <core:icon identifier="apps-toolbar-menu-opendocs" alternativeMarkupIdentifier="inline"/>
 </span>
 <span class="toolbar-item-title">{f:translate(key: 'toolbaritem', extensionName: 'opendocs')}</span>
-<span class="toolbar-item-badge badge" id="tx-opendocs-counter">{numDocs}</span>
+<span class="toolbar-item-badge badge" id="tx-opendocs-counter"></span>
 </html>