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

Yoast / Yoast-SEO-for-TYPO3 / 24723291290

21 Apr 2026 12:50PM UTC coverage: 10.457% (+9.2%) from 1.275%
24723291290

push

github

web-flow
Merge pull request #632 from Yoast/feature/yoast-v12

[FEATURE] Version 12.0.0, added v14 support, removed v11 support including php8.0 and php8.1, rewrote backend javascript functionality to typescript and webcomponents

40 of 806 new or added lines in 69 files covered. (4.96%)

40 existing lines in 23 files now uncovered.

284 of 2716 relevant lines covered (10.46%)

0.29 hits per line

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

0.0
/Classes/DataProviders/OrphanedContentDataProvider.php
1
<?php
2

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

10
declare(strict_types=1);
11

12
namespace YoastSeoForTypo3\YoastSeo\DataProviders;
13

14
use Doctrine\DBAL\Result;
15
use TYPO3\CMS\Core\Database\Connection;
16
use TYPO3\CMS\Core\Database\ConnectionPool;
17
use TYPO3\CMS\Core\Utility\GeneralUtility;
18
use YoastSeoForTypo3\YoastSeo\Constants\TableNames;
19
use YoastSeoForTypo3\YoastSeo\Utility\YoastUtility;
20

21
class OrphanedContentDataProvider extends AbstractOverviewDataProvider
22
{
23
    public function getKey(): string
24
    {
25
        return 'orphaned';
×
26
    }
27

28
    public function getLabel(): string
29
    {
30
        return 'LLL:EXT:yoast_seo/Resources/Private/Language/BackendModuleOverview.xlf:orphanedContent';
×
31
    }
32

33
    public function getDescription(): string
34
    {
35
        return 'LLL:EXT:yoast_seo/Resources/Private/Language/BackendModuleOverview.xlf:orphanedContent.description';
×
36
    }
37

38
    public function getLink(): ?string
39
    {
40
        return 'https://yoa.st/1ja';
×
41
    }
42

43
    /** @var int[] */
44
    protected array $referencedPages = [];
45

46
    /**
47
     * @param int[] $pageIds
48
     */
49
    public function getResults(array $pageIds = []): ?Result
50
    {
51
        if ($this->referencedPages === []) {
×
52
            $this->referencedPages = $this->getReferencedPages();
×
53
        }
54

NEW
55
        $qb = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(TableNames::PAGES);
×
56

57
        $constraints = [
×
58
            $qb->expr()->in('doktype', YoastUtility::getAllowedDoktypes()),
×
59
            $qb->expr()->eq('sys_language_uid', $this->dataProviderRequest->getLanguage()),
×
60
        ];
×
61
        if (count($this->referencedPages) > 0) {
×
62
            $constraints[] = $qb->expr()->notIn('uid', $this->referencedPages);
×
63
        }
64
        if (count($pageIds) > 0) {
×
65
            $constraints[] = $qb->expr()->in(
×
NEW
66
                $this->dataProviderRequest->getLanguage() > 0 ? $GLOBALS['TCA'][TableNames::PAGES]['ctrl']['transOrigPointerField'] : 'uid',
×
67
                $pageIds
×
68
            );
×
69
        }
70

71
        return $qb->select('*')
×
NEW
72
            ->from(TableNames::PAGES)
×
73
            ->where(...$constraints)
×
74
            ->executeQuery();
×
75
    }
76

77
    /**
78
     * @return int[]
79
     */
80
    protected function getReferencedPages(): array
81
    {
NEW
82
        $qb = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(TableNames::SYS_REFINDEX);
×
83

84
        $constraints = [
×
NEW
85
            $qb->expr()->eq('ref_table', $qb->createNamedParameter(TableNames::PAGES)),
×
86
            $qb->expr()->notIn(
×
87
                'field',
×
88
                $qb->createNamedParameter([
×
89
                    'l10n_parent',
×
90
                    'db_mountpoints',
×
91
                ], Connection::PARAM_STR_ARRAY)
×
92
            ),
×
93
        ];
×
94

95
        $references = $qb->select('ref_uid')
×
NEW
96
            ->from(TableNames::SYS_REFINDEX)
×
97
            ->where(...$constraints)
×
98
            ->groupBy('ref_uid')
×
99
            ->executeQuery()
×
100
            ->fetchAllAssociative();
×
101

102
        return array_column($references, 'ref_uid');
×
103
    }
104
}
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