• 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/EventListener/ModifyPageLayoutContentListener.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\EventListener;
13

14
use TYPO3\CMS\Backend\Controller\Event\ModifyPageLayoutContentEvent;
15
use YoastSeoForTypo3\YoastSeo\Dto\RequestData;
16
use YoastSeoForTypo3\YoastSeo\Service\PageLayoutHeader\PageDataService;
17
use YoastSeoForTypo3\YoastSeo\Service\PageLayoutHeader\PageLayoutHeaderRenderer;
18
use YoastSeoForTypo3\YoastSeo\Service\PageLayoutHeader\VisibilityChecker;
19
use YoastSeoForTypo3\YoastSeo\Service\SnippetPreview\SnippetPreviewConfigurationBuilder;
20
use YoastSeoForTypo3\YoastSeo\Service\SnippetPreviewService;
21

22
class ModifyPageLayoutContentListener
23
{
24
    public function __construct(
25
        protected SnippetPreviewService $snippetPreviewService,
26
        protected SnippetPreviewConfigurationBuilder $snippetPreviewConfigurationBuilder,
27
        protected PageLayoutHeaderRenderer $pageLayoutHeaderRenderer,
28
        protected VisibilityChecker $visibilityChecker,
29
        protected PageDataService $pageDataService
30
    ) {}
×
31

32
    public function __invoke(ModifyPageLayoutContentEvent $event): void
33
    {
34
        $languageId = $this->getLanguageId();
×
35
        $pageId = (int)$_GET['id'];
×
NEW
36
        $currentPage = $this->pageDataService->getCurrentPage($pageId, $languageId, $event->getModuleTemplate());
×
37

38
        if (!is_array($currentPage) || !$this->visibilityChecker->shouldShowPreview($pageId, $currentPage)) {
×
NEW
39
            return;
×
40
        }
41

42
        $this->snippetPreviewService->buildSnippetPreview(
×
NEW
43
            new RequestData($pageId, $languageId),
×
44
            $currentPage,
×
45
            $this->snippetPreviewConfigurationBuilder->buildConfigurationForPage($pageId, $currentPage, $languageId)
×
46
        );
×
47

NEW
48
        $event->addHeaderContent($this->pageLayoutHeaderRenderer->render());
×
49
    }
50

51
    protected function getLanguageId(): int
52
    {
53
        $request = $GLOBALS['TYPO3_REQUEST'] ?? null;
×
54
        if ($request === null) {
×
55
            return 0;
×
56
        }
57

58
        $moduleData = $request->getAttribute('moduleData');
×
59
        if ($moduleData === null) {
×
60
            return 0;
×
61
        }
62

63
        $language = (int)$moduleData->get('language');
×
64
        if ($language === -1) {
×
65
            return 0;
×
66
        }
67

68
        return $language;
×
69
    }
70
}
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