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

FluidTYPO3 / flux / 17904759627

15 Sep 2025 08:47AM UTC coverage: 90.676% (-2.1%) from 92.767%
17904759627

push

github

NamelessCoder
[TASK] Set beta stability

6924 of 7636 relevant lines covered (90.68%)

9.49 hits per line

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

0.0
/Classes/Integration/Overrides/PageLayoutView.php
1
<?php
2
declare(strict_types=1);
3
namespace FluidTYPO3\Flux\Integration\Overrides;
4

5
/*
6
 * This file is part of the FluidTYPO3/Flux project under GPLv2 or later.
7
 *
8
 * For the full copyright and license information, please read the
9
 * LICENSE.md file that was distributed with this source code.
10
 */
11

12
use FluidTYPO3\Flux\Provider\Interfaces\GridProviderInterface;
13
use TYPO3\CMS\Core\Database\ConnectionPool;
14
use TYPO3\CMS\Core\Utility\GeneralUtility;
15

16
class PageLayoutView extends \TYPO3\CMS\Backend\View\PageLayoutView
17
{
18
    protected array $record = [];
19

20
    /**
21
     * @var GridProviderInterface
22
     */
23
    protected $provider;
24

25
    public function setPageinfo(array $pageinfo): void
26
    {
27
        $this->pageinfo = $pageinfo;
×
28
    }
29

30
    public function getPageinfo(): array
31
    {
32
        return $this->pageinfo;
×
33
    }
34

35
    public function setProvider(GridProviderInterface $provider): void
36
    {
37
        $this->provider = $provider;
×
38
    }
39

40
    public function setRecord(array $record): void
41
    {
42
        $this->record = $record;
×
43
    }
44

45
    protected function getBackendLayoutView(): BackendLayoutView
46
    {
47
        /** @var BackendLayoutView $view */
48
        $view = GeneralUtility::makeInstance(BackendLayoutView::class);
×
49
        $view->setProvider($this->provider);
×
50
        $view->setRecord($this->record);
×
51
        return $view;
×
52
    }
53

54
    /**
55
     * @param string $table
56
     * @param int $id
57
     * @param array $columns
58
     * @param string $additionalWhereClause
59
     * @return array
60
     * @codeCoverageIgnore
61
     */
62
    protected function getContentRecordsPerColumn(
63
        $table,
64
        $id,
65
        array $columns,
66
        $additionalWhereClause = ''
67
    ): array {
68
        // Vital recursion prevention: each instance of PageLayoutView will attempt to render all records every
69
        // time - something which has started happening since the "unused content" feature was introduced. To avoid
70
        // the infinite recursion that happens because of this combined with the recursive usage of PageLayoutView,
71
        // we restrict the content elements this sub-view is capable of loading.
72
        $columns = array_filter($columns, function ($item) {
73
            return ctype_digit($item) || is_int($item);
74
        });
75
        if (empty($columns)) {
76
            return [];
77
        }
78
        /** @var ConnectionPool $connectionPool */
79
        $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
80
        $queryBuilder = $connectionPool->getQueryBuilderForTable('tt_content');
81
        $additionalWhereClause .= ' AND ' . (string) $queryBuilder->expr()->in('colPos', $columns);
82
        return parent::getContentRecordsPerColumn($table, $id, $columns, $additionalWhereClause);
83
    }
84
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc