• 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/Updates/MigrateHideSnippetPreviewToDisableAnalysis.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\Updates;
13

14
use TYPO3\CMS\Core\Database\ConnectionPool;
15
use TYPO3\CMS\Core\Utility\GeneralUtility;
16
use TYPO3\CMS\Install\Attribute\UpgradeWizard;
17
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
18
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
19
use YoastSeoForTypo3\YoastSeo\Constants\TableNames;
20

21
#[UpgradeWizard('yoastSeoMigrateHideSnippetPreviewToDisableAnalysis')]
22
class MigrateHideSnippetPreviewToDisableAnalysis implements UpgradeWizardInterface
23
{
24
    protected ConnectionPool $connectionPool;
25

26
    public function __construct()
27
    {
NEW
28
        $this->connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
×
29
    }
30

31
    public function getIdentifier(): string
32
    {
NEW
33
        return 'yoastSeoMigrateHideSnippetPreviewToDisableAnalysis';
×
34
    }
35

36
    public function getTitle(): string
37
    {
NEW
38
        return 'Yoast SEO for TYPO3 - Migrate hide snippet preview to disable analysis';
×
39
    }
40

41
    public function getDescription(): string
42
    {
NEW
43
        return 'Copies the hide_snippet_preview flag to the new disable_analysis field so existing pages keep their current behavior after the visibility split.';
×
44
    }
45

46
    public function executeUpdate(): bool
47
    {
NEW
48
        $this->connectionPool
×
NEW
49
            ->getConnectionForTable(TableNames::PAGES)
×
NEW
50
            ->executeStatement(
×
NEW
51
                'UPDATE pages SET tx_yoastseo_disable_analysis = 1 WHERE tx_yoastseo_hide_snippet_preview = 1 AND tx_yoastseo_disable_analysis = 0'
×
NEW
52
            );
×
53

NEW
54
        return true;
×
55
    }
56

57
    public function updateNecessary(): bool
58
    {
NEW
59
        $queryBuilder = $this->connectionPool->getQueryBuilderForTable(TableNames::PAGES);
×
60

NEW
61
        $count = $queryBuilder
×
NEW
62
            ->count('uid')
×
NEW
63
            ->from(TableNames::PAGES)
×
NEW
64
            ->where(
×
NEW
65
                $queryBuilder->expr()->eq('tx_yoastseo_hide_snippet_preview', 1),
×
NEW
66
                $queryBuilder->expr()->eq('tx_yoastseo_disable_analysis', 0)
×
NEW
67
            )
×
NEW
68
            ->executeQuery()
×
NEW
69
            ->fetchOne();
×
70

NEW
71
        return (int)$count > 0;
×
72
    }
73

74
    public function getPrerequisites(): array
75
    {
NEW
76
        return [
×
NEW
77
            DatabaseUpdatedPrerequisite::class,
×
NEW
78
        ];
×
79
    }
80
}
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