Skip to content

Commit

Permalink
[TASK] TYPO3 12 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
t3brightside committed Oct 13, 2022
1 parent 7e92450 commit c04310c
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 15 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,7 @@
- Fix translation handling in YoutubevideoFilesProcessor
* 2.1.1
- [BUGFIX] Eliminate undefined array key warnings
* 2.2.0
- [TASK] Add TYPO3 12 compatibility
- [TASK] Drop 10.4 LTS support
– [TASK] Rewrite back end preview using StandardContentPreviewRenderer
2 changes: 1 addition & 1 deletion Classes/DataProcessing/YoutubevideoFilesProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function process(

// Get the original cover image and title
$originalvideo = $video->getOriginalFile();
$helper = OnlineMediaHelperRegistry::getInstance()->getOnlineMediaHelper($originalvideo);
$helper = GeneralUtility::makeInstance(OnlineMediaHelperRegistry::class)->getOnlineMediaHelper($originalvideo);
$previewFileName = $helper->getPreviewImage($originalvideo);
$original = array(
'title' => $originalvideo->getProperty('title'),
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/sys_template.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
defined('TYPO3_MODE') || die('Access denied.');
defined('TYPO3_MODE') || defined('TYPO3') || die('Access denied.');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'youtubevideo', 'Configuration/TypoScript/', 'YouTube Video'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ mod.wizards.newContentElement.wizardItems.common {
show := addToList(youtubevideo_pi1)
}
TCEFORM.tt_content.tx_youtubevideo_ratio.addItems {
0 = Widescreen (16:9)
1 = Standard (4:3)
0 = Widescreen (16:9)
1 = Standard (4:3)
}
TCEFORM.tt_content.tx_youtubevideo_colcount.addItems {
0 = 1
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}
],
"require": {
"typo3/cms-core": "^10.4 ||^11.5",
"typo3/cms-fluid-styled-content": "^10.4 || ^11.5"
"typo3/cms-core": "^11.5 || ^12.0",
"typo3/cms-fluid-styled-content": "^11.5 || ^12.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
'title' => 'YouTube Video',
'description' => 'YouTube video content with custom cover images, gallery layout and backend previews.',
'category' => 'fe',
'version' => '2.1.1',
'version' => '2.2.0',
'state' => 'stable',
'clearcacheonload' => true,
'author' => 'Tanel Põld',
'author_email' => '[email protected]',
'author_company' => 'Brightside OÜ / t3brightside.com',
'constraints' => [
'depends' => [
'typo3' => '10.4.0-11.5.99',
'typo3' => '11.5.0-12.99.99',
'fluid_styled_content' => '',
],
],
Expand Down
19 changes: 13 additions & 6 deletions ext_localconf.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
<?php
defined('TYPO3_MODE') || die ('Access denied.');
defined('TYPO3_MODE') || defined('TYPO3') || die('Access denied.');

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:youtubevideo/Configuration/PageTS/setup.typoscript">');
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;

$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$versionInformation = GeneralUtility::makeInstance(Typo3Version::class);
// Only include page.tsconfig if TYPO3 version is below 12 so that it is not imported twice.
if ($versionInformation->getMajorVersion() < 12) {
ExtensionManagementUtility::addPageTSConfig('
@import "EXT:youtubevideo/Configuration/page.tsconfig"
');
}

$iconRegistry = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
'youtubevideo_icon',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:youtubevideo/Resources/Public/Icons/ext_icon_content.svg']
);

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['youtubevideo_pi1']
= \Brightside\Youtubevideo\Hooks\PageLayoutView\YoutubevideoContentElementPreviewRenderer::class;

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals']['Brightside\\Youtubevideo\\Evaluation\\HoursMinutesSeconds'] = '';
2 changes: 1 addition & 1 deletion ext_tables.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

defined('TYPO3_MODE') || die('Access denied.');
defined('TYPO3_MODE') || defined('TYPO3') || die('Access denied.');

$GLOBALS['TBE_STYLES']['skins']['youtubevideo']['stylesheetDirectories'][] =
'EXT:youtubevideo/Resources/Public/Styles/Backend/';

0 comments on commit c04310c

Please sign in to comment.