Skip to content

Commit

Permalink
[BUGFIX] EXT:opendocs - Remove bogus initial document count
Browse files Browse the repository at this point in the history
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 <noreply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
  • Loading branch information
andreaskienast authored and maddy2101 committed Feb 16, 2019
1 parent 91898b9 commit 6022f21
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Expand Up @@ -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();
}
Expand Down
Expand Up @@ -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;
Expand All @@ -37,7 +36,7 @@ class OpenDocumentController
protected $documents;

/**
* @var SystemInformationToolbarItem
* @var OpendocsToolbarItem
*/
protected $toolbarItem;

Expand Down
Expand Up @@ -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>

0 comments on commit 6022f21

Please sign in to comment.