• 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/Service/PageLayoutHeader/PageDataService.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\Service\PageLayoutHeader;
13

14
use TYPO3\CMS\Backend\Controller\PageLayoutController;
15
use TYPO3\CMS\Backend\Template\ModuleTemplate;
16
use TYPO3\CMS\Backend\Utility\BackendUtility;
17
use YoastSeoForTypo3\YoastSeo\Constants\TableNames;
18

19
class PageDataService
20
{
21
    /**
22
     * @return array<string, string>|null
23
     */
24
    public function getCurrentPage(int $pageId, int $languageId, PageLayoutController|ModuleTemplate|null $parentObj): ?array
25
    {
26
        if ((!$parentObj instanceof PageLayoutController && !$parentObj instanceof ModuleTemplate) || $pageId <= 0) {
×
27
            return null;
×
28
        }
29

30
        if ($languageId === 0) {
×
31
            return $this->getPageRecord($pageId);
×
32
        }
33

NEW
34
        if ($languageId < 0) {
×
NEW
35
            return null;
×
36
        }
37

NEW
38
        $overlayRecords = $this->getOverlayRecords($pageId, $languageId);
×
39

NEW
40
        if (is_array($overlayRecords[0] ?? false)) {
×
NEW
41
            return $overlayRecords[0];
×
42
        }
43

44
        return null;
×
45
    }
46

47
    /**
48
     * @return array<string, string>
49
     */
50
    protected function getPageRecord(int $pageId): array
51
    {
52
        return BackendUtility::getRecord(
×
NEW
53
            TableNames::PAGES,
×
54
            $pageId
×
55
        ) ?? [];
×
56
    }
57

58
    /**
59
     * @return array<int, array<string, mixed>>|null
60
     */
61
    protected function getOverlayRecords(int $pageId, int $languageId): ?array
62
    {
NEW
63
        $recordLocalization = BackendUtility::getRecordLocalization(
×
NEW
64
            TableNames::PAGES,
×
65
            $pageId,
×
66
            $languageId
×
67
        );
×
NEW
68
        if (is_array($recordLocalization)) {
×
NEW
69
            return $recordLocalization;
×
70
        }
NEW
71
        return null;
×
72
    }
73
}
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