Modernize for TYPO3 v13/v14#17
Open
davidsteeb wants to merge 3 commits into
Open
Conversation
Drop support for TYPO3 10/11/12 and PHP < 8.2. * Remove dead code: ext_tables.sql (TCA auto-schema), ext_localconf.php (legacy pre-v12 hook + duplicate icon registration), Classes/Hooks/ (PageLayoutViewDrawItemHookInterface removed in v12), Classes/Listener/ PageContentPreviewRendering (now handled in ContentPreviewRenderer). * Ship configuration as a Site Set under Configuration/Sets/codeblock/ instead of relying on integrators to @import TypoScript and PageTSconfig. * Use constructor injection for Highlighter in HighlightProcessor and CodeLanguages; mark both as public services so TYPO3 can resolve them. * Fix the auto-detect default for code_language (?? true was wrong). * Truncate the page-module preview with mb_strimwidth. * Refresh GitHub Actions workflow to ubuntu-latest, checkout@v4, PHP 8.2, GITHUB_OUTPUT syntax. * Rewrite README, add CHANGELOG documenting 3.0.0 breaking changes.
Replace the legacy addTcaSelectItem() + manual typeicon_classes + manual $GLOBALS['TCA']['tt_content']['types']['codeblock'] assignment + page.tsconfig wizard registration with a single ExtensionManagementUtility::addRecordType() call. addRecordType() (TYPO3 v13+) is the official convenience method that supersedes addPlugin() and addTcaSelectItem() for CType registration. It registers the select item, the typeicon, the wizard entry (group, title, description, icon) and the type's showitem / columnsOverrides / previewRenderer in one call, and automatically appends the 'extended' tab to the showitem string. The wizard registration in Configuration/Sets/codeblock/page.tsconfig is now redundant and removed. The code_language column is inlined in the type-specific showitem instead of being injected via addToAllTCAtypes().
The extension uses classes from typo3/cms-backend (StandardContentPreviewRenderer, GridColumnItem) and typo3/cms-frontend (ContentObjectRenderer, DataProcessorInterface), but composer.json only declared typo3/cms-core. Add both as direct dependencies so slimmed-down installs resolve correctly and the dependency graph reflects actual usage. Also adds a 'description' field to the Site Set config so editors see what the Set provides in the backend "Sets for this Site" UI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop support for TYPO3 10/11/12 and PHP < 8.2.