• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

fnagel / t3extblog / 32822688124

24 Aug 2026 09:50PM UTC coverage: 76.723% (-0.7%) from 77.401%
32822688124

push

github

fnagel
[FEATURE] Add limit setting to all list based dashboard widgets

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/14.0/Feature-107036-ConfigurableDashboardWidgets.html
https://docs.typo3.org/c/typo3/cms-dashboard/14.3/en-us/Developer/ConfigurableWidgets.html

2 of 32 new or added lines in 2 files covered. (6.25%)

40 existing lines in 11 files now uncovered.

2650 of 3454 relevant lines covered (76.72%)

7.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Classes/DataProcessing/AbstractRecordMenuProcessor.php
1
<?php
2

3
namespace FelixNagel\T3extblog\DataProcessing;
4

5
/**
6
 * This file is part of the "t3extblog" Extension for TYPO3 CMS.
7
 *
8
 * For the full copyright and license information, please read the
9
 * LICENSE.txt file that was distributed with this source code.
10
 */
11

12
use FelixNagel\T3extblog\Utility\FrontendUtility;
13
use TYPO3\CMS\Core\Utility\GeneralUtility;
14
use TYPO3\CMS\Extbase\Persistence\RepositoryInterface;
15
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
16
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
17

18
abstract class AbstractRecordMenuProcessor implements DataProcessorInterface
19
{
20
    abstract protected function getRepository(array $configuration): RepositoryInterface;
21

22
    abstract protected function getUid(array $configuration, ContentObjectRenderer $cObj): ?int;
23

24
    abstract protected function getRecord(array $configuration, int $uid): ?array;
25

UNCOV
26
    protected function getTitle(array $record): string
×
27
    {
UNCOV
28
        return $record['title'];
×
29
    }
30

31
    /**
32
     * @SuppressWarnings("PHPMD.UnusedFormalParameter")
33
     */
UNCOV
34
    public function process(
×
35
        ContentObjectRenderer $cObj,
36
        array $contentObjectConfiguration,
37
        array $processorConfiguration,
38
        array $processedData
39
    ): array {
40
        if (!$processorConfiguration['as']) {
×
UNCOV
41
            return $processedData;
×
42
        }
43

44
        if (($uid = $this->getUid($processorConfiguration, $cObj)) === null) {
×
UNCOV
45
            return $processedData;
×
46
        }
47

UNCOV
48
        $record = $this->getRecord($processorConfiguration, $uid);
×
49

50
        if ($record) {
×
51
            foreach (GeneralUtility::trimExplode(',', $processorConfiguration['as'], true) as $menu) {
×
52
                if (isset($processedData[$menu])) {
×
UNCOV
53
                    $this->addRecordToMenu($record, $processedData[$menu]);
×
54
                }
55
            }
56
        }
57

UNCOV
58
        return $processedData;
×
59
    }
60

UNCOV
61
    protected function addRecordToMenu(array $record, array &$menu): void
×
62
    {
63
        foreach ($menu as &$menuItem) {
×
UNCOV
64
            $menuItem['current'] = 0;
×
65
        }
66

67
        $menu[] = [
×
68
            'data' => $record,
×
69
            'title' => $this->getTitle($record),
×
70
            'active' => 1,
×
71
            'current' => 1,
×
72
            'link' => FrontendUtility::getNormalizedParams()->getSiteScript(),
×
UNCOV
73
        ];
×
74
    }
75
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc