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

Yoast / Yoast-SEO-for-TYPO3 / 21521134747

30 Jan 2026 03:30PM UTC coverage: 0.866% (-0.4%) from 1.275%
21521134747

push

github

RinyVT
[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

0 of 550 new or added lines in 53 files covered. (0.0%)

33 existing lines in 21 files now uncovered.

23 of 2657 relevant lines covered (0.87%)

0.03 hits per line

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

0.0
/Classes/Record/RecordService.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\Record;
13

14
use TYPO3\CMS\Core\Database\ConnectionPool;
15
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
16
use TYPO3\CMS\Core\SingletonInterface;
17
use TYPO3\CMS\Core\Utility\ArrayUtility;
18
use TYPO3\CMS\Core\Utility\Exception\MissingArrayPathException;
19

20
class RecordService implements SingletonInterface
21
{
22
    protected bool $recordsChecked = false;
23
    protected ?Record $activeRecord = null;
24

25
    public function __construct(
26
        protected readonly ConnectionPool $connectionPool,
27
        protected readonly PageRepository $pageRepository
NEW
28
    ) {}
×
29

30
    public function getActiveRecord(): ?Record
31
    {
32
        if ($this->recordsChecked) {
×
33
            return $this->activeRecord;
×
34
        }
35

36
        $records = RecordRegistry::getInstance()->getRecords(true);
×
37
        if (empty($records)) {
×
38
            $this->recordsChecked = true;
×
39
            return null;
×
40
        }
41

42
        $this->activeRecord = $this->findRecord($records);
×
43
        if ($this->activeRecord instanceof Record) {
×
44
            $recordData = $this->getRecordData($this->activeRecord);
×
45
            $this->activeRecord->setRecordData($recordData);
×
46
        }
47

48
        $this->recordsChecked = true;
×
49
        return $this->activeRecord;
×
50
    }
51

52
    /**
53
     * @param Record[] $records
54
     * @return Record|null
55
     */
56
    protected function findRecord(array $records): ?Record
57
    {
58
        $currentGetParameters = $_GET;
×
59

60
        foreach ($records as $record) {
×
61
            if (empty($record->getGetParameters())) {
×
62
                continue;
×
63
            }
64

65
            foreach ($record->getGetParameters() as $getParameters) {
×
66
                try {
67
                    $getValue = ArrayUtility::getValueByPath($currentGetParameters, implode('/', $getParameters));
×
NEW
68
                } catch (MissingArrayPathException) {
×
69
                    $getValue = null;
×
70
                }
71
                if ($getValue !== null) {
×
72
                    $record->setRecordUid((int)$getValue);
×
73
                    return $record;
×
74
                }
75
            }
76
        }
77

78
        return null;
×
79
    }
80

81
    /**
82
     * @return array<string, mixed>
83
     */
84
    protected function getRecordData(Record $record): array
85
    {
NEW
86
        $recordRow = $this->connectionPool
×
87
            ->getConnectionForTable($record->getTableName())
×
88
            ->select(['*'], $record->getTableName(), ['uid' => $record->getRecordUid()])
×
89
            ->fetchAssociative();
×
90

NEW
91
        return (array)$this->pageRepository->getLanguageOverlay($record->getTableName(), (array)$recordRow);
×
92
    }
93
}
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