Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYPO3 13 Compatibility #821

Merged
merged 7 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Classes/DataProcessing/DisableLanguageMenuProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use HDNET\Calendarize\Service\IndexerService;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction;
use TYPO3\CMS\Core\Routing\PageArguments;
Expand Down Expand Up @@ -107,12 +108,12 @@ protected function getAvailableLanguages(int $indexId): array
// Current language of the record
$queryBuilder->expr()->eq(
'uid',
$queryBuilder->createNamedParameter($indexId, \PDO::PARAM_INT)
$queryBuilder->createNamedParameter($indexId, Connection::PARAM_INT)
),
// Translated versions of the records (found by l10n_parent)
$queryBuilder->expr()->eq(
$transOrigPointerField,
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, Connection::PARAM_INT)
)
)
)
Expand Down
3 changes: 2 additions & 1 deletion Classes/Domain/Repository/RawIndexRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use HDNET\Calendarize\Utility\DateTimeUtility;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction;
Expand Down Expand Up @@ -96,7 +97,7 @@ public function findEventsAfterStartDate(
),
$queryBuilder->expr()->eq(
'foreign_uid',
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
$queryBuilder->createNamedParameter($uid, Connection::PARAM_INT)
)
)
)
Expand Down
3 changes: 2 additions & 1 deletion Classes/EventListener/CategoryConstraintEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use HDNET\Calendarize\Event\IndexRepositoryDefaultConstraintEvent;
use HDNET\Calendarize\Register;
use HDNET\Calendarize\Utility\HelperUtility;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Utility\MathUtility;

class CategoryConstraintEventListener
Expand Down Expand Up @@ -175,7 +176,7 @@ protected function getIndexIds(array $categories, string $conjunction, array $ta
)
)->having(
'COUNT(DISTINCT ' . $queryBuilder->quoteIdentifier($uidLocal_field) . ') = '
. $queryBuilder->createNamedParameter(\count($categories), \PDO::PARAM_INT)
. $queryBuilder->createNamedParameter(\count($categories), Connection::PARAM_INT)
);
break;

Expand Down
5 changes: 3 additions & 2 deletions Classes/EventListener/CategoryFilterEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use HDNET\Calendarize\Controller\CalendarController;
use HDNET\Calendarize\Domain\Repository\CategoryRepository;
use HDNET\Calendarize\Event\GenericActionAssignmentEvent;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;

Expand Down Expand Up @@ -56,11 +57,11 @@ protected function getCategories(string $tableName, string $fieldName): array
$queryBuilder->expr()->and(
$queryBuilder->expr()->eq(
'sys_category_record_mm.tablenames',
$queryBuilder->createNamedParameter($tableName, \PDO::PARAM_STR)
$queryBuilder->createNamedParameter($tableName, Connection::PARAM_STR)
),
$queryBuilder->expr()->eq(
'sys_category_record_mm.fieldname',
$queryBuilder->createNamedParameter($fieldName, \PDO::PARAM_STR)
$queryBuilder->createNamedParameter($fieldName, Connection::PARAM_STR)
)
)
);
Expand Down
3 changes: 2 additions & 1 deletion Classes/EventListener/PreviewRenderingEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Imaging\IconSize;

/**
* Provides backend preview for calendarize plugins.
Expand All @@ -36,7 +37,7 @@ public function __invoke(PageContentPreviewRenderingEvent $event): void
return;
}

$extensionIconUsage = $this->iconFactory->getIcon('ext-calendarize-wizard-icon', Icon::SIZE_SMALL)->render();
$extensionIconUsage = $this->iconFactory->getIcon('ext-calendarize-wizard-icon', IconSize::SMALL)->render();
$this->layoutService->setTitle($extensionIconUsage . ' Calendarize');

$listType = explode('_', $record['list_type'], 2)[1] ?? '';
Expand Down
3 changes: 2 additions & 1 deletion Classes/Utility/EventUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Http\ApplicationType;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -70,7 +71,7 @@ public static function getOriginalRecordByConfigurationInWorkspace(
$queryBuilder->select('*')
->from($table)
->where(
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, Connection::PARAM_INT))
);

$row = $queryBuilder->executeQuery()->fetchAssociative();
Expand Down
11 changes: 3 additions & 8 deletions Classes/ViewHelpers/TitleTagViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@
*/
class TitleTagViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;

/**
* Render the title function.
*
* @return string
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
): void {
$content = trim((string)$renderChildrenClosure());
public function render(): void
{
$content = trim((string)$this->renderChildren());
if (!empty($content)) {
GeneralUtility::makeInstance(CalendarizeTitleProvider::class)->setTitle($content);
}
Expand Down
27 changes: 26 additions & 1 deletion Configuration/TCA/tx_calendarize_domain_model_configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,32 @@
'default' => '',
],
],
'fe_group' => $GLOBALS['TCA']['tt_content']['columns']['fe_group'],
'fe_group' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.fe_group',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'size' => 5,
'maxitems' => 20,
'items' => [
0 => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login',
'value' => -1,
],
1 => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login',
'value' => -2,
],
2 => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.usergroups',
'value' => '--div--',
],
],
'exclusiveKeys' => '-1,-2',
'foreign_table' => 'fe_groups',
],
],
'editlock' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:editlock',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,32 @@
'searchFields' => 'uid,title',
],
'columns' => [
'fe_group' => $GLOBALS['TCA']['tt_content']['columns']['fe_group'],
'fe_group' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.fe_group',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'size' => 5,
'maxitems' => 20,
'items' => [
0 => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login',
'value' => -1,
],
1 => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login',
'value' => -2,
],
2 => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.usergroups',
'value' => '--div--',
],
],
'exclusiveKeys' => '-1,-2',
'foreign_table' => 'fe_groups',
],
],
'editlock' => [
'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:editlock',
Expand Down
4 changes: 4 additions & 0 deletions Configuration/page.tsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

@import 'EXT:calendarize/Configuration/TsConfig/Page/Mod/Wizards/NewContentElement.tsconfig'
@import 'EXT:calendarize/Configuration/TsConfig/Page/TCEMAIN/LinkHandler.tsconfig'

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(\DateTimeZone $timeZone = null)
$this->timeZone = $timeZone ? $timeZone : $this->timeZoneUTC;
}

public function processLine($keyword, $value, $keywordProperties = '')
public function processLine($keyword, $value, $keywordProperties = ''): void
{
if ($keyword == 'UID') {
$this->uid = $value;
Expand Down Expand Up @@ -160,7 +160,7 @@ public function getUid()
return $this->uid;
}

public function setUid($uid)
public function setUid($uid): void
{
$this->uid = $uid;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct()
{
}

public function processLine($keyword, $value)
public function processLine($keyword, $value): void
{
if ($keyword == 'TZID') {
$timezoneIdentifiers = \DateTimeZone::listIdentifiers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class ExDateTest extends \PHPUnit_Framework_TestCase
{
public function test1()
public function test1(): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/exdate1.ics'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function dataForTestGeo1()
/**
* @dataProvider dataForTestGeo1
*/
public function testGeo1($filename, $lat, $lng)
public function testGeo1($filename, $lat, $lng): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/' . $filename));
Expand All @@ -47,7 +47,7 @@ public function dataForTestNoGeo1()
/**
* @dataProvider dataForTestNoGeo1
*/
public function testNoGeo1($filename)
public function testNoGeo1($filename): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/' . $filename));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function dataForTestMultiLineDescription()
/**
* @dataProvider dataForTestMultiLineDescription
*/
public function testMultiLineDescription($filename, $output)
public function testMultiLineDescription($filename, $output): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/' . $filename));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function dataForTestRRule()
/**
* @dataProvider dataForTestRRule
*/
public function testGetByPosition($filename, $rrule)
public function testGetByPosition($filename, $rrule): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/' . $filename));
Expand All @@ -40,7 +40,7 @@ public function testGetByPosition($filename, $rrule)
/**
* @dataProvider dataForTestRRule
*/
public function testGetByArray($filename, $rrule)
public function testGetByArray($filename, $rrule): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/' . $filename));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class RawTest extends \PHPUnit_Framework_TestCase
{
public function testGetDefaultValuesIfKeyNotFound()
public function testGetDefaultValuesIfKeyNotFound(): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/rawtest1.ics'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public function dataForTestTimeZone1()
/**
* @dataProvider dataForTestTimeZone1
*/
public function testTimeZone1($filename, $timeZone)
public function testTimeZone1($filename, $timeZone): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/' . $filename));
$this->assertEquals($timeZone, $parser->getTimeZoneIdentifier());
}

public function testTimeZoneFromFileToEvent1()
public function testTimeZoneFromFileToEvent1(): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/TimeZone1.ics'));
Expand All @@ -42,7 +42,7 @@ public function testTimeZoneFromFileToEvent1()
$this->assertEquals('2016-10-11T20:00:00+00:00', $event->getEnd()->format('c'));
}

public function testTimeZoneFromMeetupToEvent1()
public function testTimeZoneFromMeetupToEvent1(): void
{
$parser = new ICalParser();
$this->assertTrue($parser->parseFromFile(dirname(__FILE__) . '/data/Meetup1.ics'));
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"php": "^8.1",
"ext-json": "*",
"ext-pdo": "*",
"typo3/cms-core": "^12.4",
"typo3/cms-core": "^13.4",
"sabre/vobject": "^4.2"
},
"replace": {
Expand All @@ -53,7 +53,7 @@
},
"require-dev": {
"typo3/testing-framework": "^8.0",
"typo3/cms-workspaces": "^12.4",
"typo3/cms-workspaces": "^13.4",
"friendsofphp/php-cs-fixer": "^3.0",
"phpmd/phpmd": "^2.4",
"scrutinizer/ocular": "^1.3",
Expand Down
6 changes: 3 additions & 3 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
'title' => 'Calendarize - Event Management',
'description' => 'Create a structure for timely controlled tables (e.g. events) and one plugin for the different output of calendar views (list, detail, month, year, day, week...). The extension is shipped with one default event table, but you can also "calendarize" your own table/model. It is completely independent and configurable! Use your own models as event items in this calender. Development on https://github.com/lochmueller/calendarize',
'category' => 'fe',
'version' => '13.0.7',
'version' => '13.0.0-dev',
'state' => 'stable',
'clearcacheonload' => 1,
'author' => 'Tim Lochmüller',
'author_email' => '[email protected]',
'constraints' => [
'depends' => [
'typo3' => '12.4.0-12.4.99',
'php' => '8.1.0-8.99.99',
'typo3' => '13.4.0-13.4.99',
'php' => '8.2.0-8.3.99',
],
'suggests' => [
'dashboard' => '12.4.0-12.4.99',
Expand Down
6 changes: 0 additions & 6 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,6 @@
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['calendarize'] =
ProcessDatamapClass::class;

// Include new content elements to modWizards
ExtensionManagementUtility::addPageTSConfig("
@import 'EXT:calendarize/Configuration/TsConfig/Page/Mod/Wizards/NewContentElement.tsconfig'
@import 'EXT:calendarize/Configuration/TsConfig/Page/TCEMAIN/LinkHandler.tsconfig'
");

$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1591803668] = [
'nodeName' => 'calendarizeInfoElement',
'priority' => 40,
Expand Down
Loading