Skip to content

Feature/typo3 v14 compatibility#878

Open
chrisprog20 wants to merge 3 commits intoTYPO3-Headless:feature/typo3-v14from
chrisprog20:feature/typo3-v14-compatibility
Open

Feature/typo3 v14 compatibility#878
chrisprog20 wants to merge 3 commits intoTYPO3-Headless:feature/typo3-v14from
chrisprog20:feature/typo3-v14-compatibility

Conversation

@chrisprog20
Copy link
Copy Markdown

@chrisprog20 chrisprog20 commented Apr 13, 2026

The first and third commit below prevent errors during a composer require of friendsoftypo3/headless in main branch of TYPO3. The second commit applied rector to make the extension compatible with current main branch of TYPO3. They serve to be able to run the headless extension in a TYPO3 14.3 LTS installation.

chrisprog20 and others added 3 commits March 26, 2026 13:50
Prevent fatal error:

Fatal error: Declaration of FriendsOfTYPO3\Headless\Seo\MetaTag\AbstractMetaTagManager::renderProperty(string $property): string must be compatible with TYPO3\CMS\Core\MetaTag\AbstractMetaTagManager::renderProperty(string $property, ?TYPO3\CMS\Core\Type\DocType $docType = null): string
Used rector config

return RectorConfig::configure()
    ->withPaths([
        __DIR__ . '/vendor/friendsoftypo3/headless',
    ])
    // uncomment to reach your current PHP version
    // ->withPhpSets()
    ->withPhpVersion(PhpVersion::PHP_82)
    ->withSets([
        // Rector rules
        //SetList::CODE_QUALITY,
        //LevelSetList::UP_TO_PHP_82,

        //Typo3SetList::CODE_QUALITY,
        //Typo3SetList::GENERAL,
        Typo3LevelSetList::UP_TO_TYPO3_14,
        // To migrate to Doctrine Dbal 4, uncomment the following line
        \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_DBAL_40,
    ])
    // To have a better analysis from PHPStan, we teach it here some more things
    ->withPHPStanConfigs([Typo3Option::PHPSTAN_FOR_RECTOR_PATH])
    //->withImportNames(true, true, false, true)
    ->withRules([
        AddVoidReturnTypeWhereNoReturnRector::class,
        ConvertImplicitVariablesToExplicitGlobalsRector::class,
    ])
    //->withConfiguredRule(ExtEmConfRector::class, [
        //ExtEmConfRector::PHP_VERSION_CONSTRAINT => '8.2.0-8.4.99',
        //ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '14.0.0-14.3.99',
        //ExtEmConfRector::ADDITIONAL_VALUES_TO_BE_REMOVED => [],
    //])
    ->withConfiguredRule(
        RemoveTypo3VersionChecksRector::class,
        [RemoveTypo3VersionChecksRector::TARGET_VERSION => 14]
    )
    ->withSkip([
        // @see sabbelasichon/typo3-rector#2536
        __DIR__ . '/**/Configuration/ExtensionBuilder/*',
        NameImportingPostRector::class => [
            'ClassAliasMap.php',
        ]
    ])
;

For the TYPO3 14 rules set also the T3 14 TCA rule set has been applied and the T3 14.2 rule set.
…ervice cannot extend readonly class TYPO3\CMS\Extbase\Service\ImageService'
/**
* @codeCoverageIgnore
*/
readonly class PreviewController extends \TYPO3\CMS\Workspaces\Controller\PreviewController
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this xclass will be problematic if someone has workspaces installed, in TYPO3 v14 this class is final, so should remove this xclass, and find workaround for maintaining this feature in v14

Copy link
Copy Markdown
Collaborator

@twoldanski twoldanski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for PR, looks good to me, only we have to drop xclass for time being

@chrisprog20
Copy link
Copy Markdown
Author

@twoldanski You're welcome. So you care about the dropping of the xclass, right? I have no clue at the moment how to solve this. Or could you give me a hint?

@twoldanski
Copy link
Copy Markdown
Collaborator

@chrisprog20 drop it, for now we can't do anything with it really, we have to collaborate with core team to introduce some event to handle this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants