From 8eb784cbb3fc1985259d5a5ee905519cbe3cadd7 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Wed, 6 Nov 2024 07:54:30 +0100 Subject: [PATCH] Further removals --- Classes/Updates/MigrateDuplicateLocations.php | 195 ------------- Classes/Updates/MigrateOldLocations.php | 267 ------------------ .../Updates/MigratePluginsFromListToCtype.php | 59 ---- Configuration/FlexForms/DateList.xml | 219 -------------- Configuration/FlexForms/DateSearch.xml | 32 --- Configuration/FlexForms/DateShow.xml | 50 ---- Configuration/FlexForms/Selected.xml | 21 -- Configuration/Routing.yaml | 27 -- Configuration/Services.yaml | 6 - Configuration/TCA/Overrides/tt_content.php | 70 ----- .../Mod/Wizards/NewContentElement.tsconfig | 38 --- Configuration/TypoScript/constants.typoscript | 13 - Configuration/TypoScript/setup.typoscript | 49 ---- Configuration/page.tsconfig | 1 - Documentation/Changelog/5.0.0.rst | 20 +- Resources/Private/Layouts/Default.html | 5 - .../Private/Partials/Date/ListDefault.html | 37 --- .../Private/Partials/Date/ListTable.html | 60 ---- .../Private/Partials/Event/SearchForm.html | 14 - Resources/Private/Partials/Pagination.html | 94 ------ Resources/Private/Templates/Date/List.html | 19 -- Resources/Private/Templates/Date/Search.html | 75 ----- Resources/Private/Templates/Date/Show.html | 74 ----- Resources/Private/Templates/Date/Teaser.html | 50 ---- Resources/Private/Templates/Event/List.html | 33 --- Resources/Private/Templates/Event/Search.html | 29 -- Resources/Private/Templates/Event/Show.html | 37 --- Resources/Private/Templates/Event/Teaser.html | 33 --- .../Functional/AbstractFunctionalTestCase.php | 2 +- .../Frontend/AbstractFrontendTestCase.php | 46 +++ Tests/Functional/Frontend/CacheTest.php | 8 +- Tests/Functional/Frontend/DatesTest.php | 25 +- .../DatesTestFixtures/DateMetaTags.php | 2 +- .../DatesTestFixtures/DateOpenGraphTags.php | 2 +- .../DatesTestFixtures/DatePageTitle.php | 2 +- .../DatesTestFixtures/DateSocialMediaTags.php | 2 +- .../Returns404IfEventIsHidden.php | 2 +- .../ReturnsDateWithinTimeSpan.php | 2 +- ...rnsOnlyDatesWithAvailableEventByDemand.php | 2 +- .../ReturnsUpcomingDates.php | 2 +- Tests/Functional/Frontend/EventsTest.php | 20 +- .../EventsTestFixtures/EventMetaTags.php | 2 +- .../EventsTestFixtures/EventOpenGraphTags.php | 2 +- .../EventsTestFixtures/EventPageTitle.php | 2 +- .../EventSocialMediaTags.php | 2 +- Tests/Functional/Frontend/FilterTest.php | 11 +- .../FilterByASingleLocationViaFlexform.php | 2 +- .../FilterByTwoLocationsViaFlexform.php | 2 +- ...FilterDatesByParentLocationViaFlexform.php | 2 +- .../Private/Templates/Date/List.html | 35 +++ .../Private/Templates/Date/Show.html | 73 +++++ .../Private/Templates/Event/Show.html | 36 +++ .../Extensions/example/ext_localconf.php | 10 +- .../Fixtures/TypoScript/Rendering.typoscript | 12 + .../ImportsAllConfigurationTest.php | 2 +- .../Assertions/MigrateDuplicateLocations.php | 61 ---- .../Fixtures/MigrateDuplicateLocations.php | 76 ----- .../MigrateDuplicateLocationsNoDuplicates.php | 38 --- .../Updates/MigrateDuplicateLocationsTest.php | 68 ----- ext_localconf.php | 36 --- phpstan-baseline.neon | 5 - 61 files changed, 247 insertions(+), 1974 deletions(-) delete mode 100644 Classes/Updates/MigrateDuplicateLocations.php delete mode 100644 Classes/Updates/MigrateOldLocations.php delete mode 100644 Classes/Updates/MigratePluginsFromListToCtype.php delete mode 100644 Configuration/FlexForms/DateList.xml delete mode 100644 Configuration/FlexForms/DateSearch.xml delete mode 100644 Configuration/FlexForms/DateShow.xml delete mode 100644 Configuration/FlexForms/Selected.xml delete mode 100644 Configuration/Routing.yaml delete mode 100644 Configuration/TCA/Overrides/tt_content.php delete mode 100644 Configuration/TsConfig/Page/Mod/Wizards/NewContentElement.tsconfig delete mode 100644 Configuration/page.tsconfig delete mode 100644 Resources/Private/Layouts/Default.html delete mode 100644 Resources/Private/Partials/Date/ListDefault.html delete mode 100644 Resources/Private/Partials/Date/ListTable.html delete mode 100644 Resources/Private/Partials/Event/SearchForm.html delete mode 100644 Resources/Private/Partials/Pagination.html delete mode 100644 Resources/Private/Templates/Date/List.html delete mode 100644 Resources/Private/Templates/Date/Search.html delete mode 100644 Resources/Private/Templates/Date/Show.html delete mode 100644 Resources/Private/Templates/Date/Teaser.html delete mode 100644 Resources/Private/Templates/Event/List.html delete mode 100644 Resources/Private/Templates/Event/Search.html delete mode 100644 Resources/Private/Templates/Event/Show.html delete mode 100644 Resources/Private/Templates/Event/Teaser.html create mode 100644 Tests/Functional/Frontend/AbstractFrontendTestCase.php create mode 100644 Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Date/List.html create mode 100644 Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Date/Show.html create mode 100644 Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Event/Show.html delete mode 100644 Tests/Functional/Updates/Assertions/MigrateDuplicateLocations.php delete mode 100644 Tests/Functional/Updates/Fixtures/MigrateDuplicateLocations.php delete mode 100644 Tests/Functional/Updates/Fixtures/MigrateDuplicateLocationsNoDuplicates.php delete mode 100644 Tests/Functional/Updates/MigrateDuplicateLocationsTest.php diff --git a/Classes/Updates/MigrateDuplicateLocations.php b/Classes/Updates/MigrateDuplicateLocations.php deleted file mode 100644 index e7fbf0c..0000000 --- a/Classes/Updates/MigrateDuplicateLocations.php +++ /dev/null @@ -1,195 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -namespace WerkraumMedia\Events\Updates; - -use Generator; -use TYPO3\CMS\Core\Database\Connection; -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Install\Attribute\UpgradeWizard; -use TYPO3\CMS\Install\Updates\UpgradeWizardInterface; -use WerkraumMedia\Events\Domain\Model\Location; - -#[UpgradeWizard(MigrateDuplicateLocations::class)] -final class MigrateDuplicateLocations implements UpgradeWizardInterface -{ - public function __construct( - private readonly ConnectionPool $connectionPool - ) { - } - - public function getIdentifier(): string - { - return self::class; - } - - public function getTitle(): string - { - return 'Remove duplicate locations of EXT:event'; - } - - public function getDescription(): string - { - return 'Checks for duplicates and reduces them to one entry, fixing relations to events.'; - } - - public function updateNecessary(): bool - { - return true; - } - - public function executeUpdate(): bool - { - $duplicates = []; - - foreach ($this->getLocations() as $location) { - $locationObject = $this->buildObject($location); - if ($locationObject->getGlobalId() === $location['global_id']) { - continue; - } - - $uid = (int)$location['uid']; - $matchingLocation = $this->getMatchingLocation( - $locationObject->getGlobalId(), - $uid - ); - - // Already have entries for the new id, this one is duplicate - if ($matchingLocation > 0) { - $duplicates[$uid] = $matchingLocation; - continue; - } - - // No duplicates, update this one - $this->updateLocation($locationObject, $uid); - } - - $this->removeDuplicates(array_keys($duplicates)); - $this->updateRelations($duplicates); - return true; - } - - public function getPrerequisites(): array - { - return []; - } - - /** - * @return Generator - */ - private function getLocations(): Generator - { - $queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_location'); - $queryBuilder->select( - 'name', - 'street', - 'zip', - 'city', - 'district', - 'country', - 'phone', - 'latitude', - 'longitude', - 'global_id', - 'uid', - 'sys_language_uid' - ); - $queryBuilder->from('tx_events_domain_model_location'); - $queryBuilder->orderBy('uid', 'asc'); - $result = $queryBuilder->executeQuery(); - - foreach ($result->fetchAllAssociative() as $location) { - yield $location; - } - } - - private function getMatchingLocation( - string $globalId, - int $uid - ): int { - $queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_location'); - $queryBuilder->select('uid'); - $queryBuilder->from('tx_events_domain_model_location'); - $queryBuilder->where($queryBuilder->expr()->eq('global_id', $queryBuilder->createNamedParameter($globalId))); - $queryBuilder->andWhere($queryBuilder->expr()->neq('uid', $queryBuilder->createNamedParameter($uid))); - $queryBuilder->setMaxResults(1); - - $uid = $queryBuilder->executeQuery()->fetchOne(); - if (is_numeric($uid) === false) { - return 0; - } - - return (int)$uid; - } - - private function buildObject(array $location): Location - { - return new Location( - $location['name'], - $location['street'], - $location['zip'], - $location['city'], - $location['district'], - $location['country'], - $location['phone'], - $location['latitude'], - $location['longitude'], - (int)$location['sys_language_uid'] - ); - } - - private function updateLocation(Location $location, int $uid): void - { - $queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_location'); - $queryBuilder->update('tx_events_domain_model_location'); - $queryBuilder->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid))); - $queryBuilder->set('global_id', $location->getGlobalId()); - $queryBuilder->set('latitude', $location->getLatitude()); - $queryBuilder->set('longitude', $location->getLongitude()); - $queryBuilder->executeStatement(); - } - - /** - * @param int[] $uids - */ - private function removeDuplicates(array $uids): void - { - $queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_location'); - $queryBuilder->delete('tx_events_domain_model_location'); - $queryBuilder->where($queryBuilder->expr()->in('uid', $queryBuilder->createNamedParameter($uids, Connection::PARAM_INT_ARRAY))); - $queryBuilder->executeStatement(); - } - - private function updateRelations(array $migration): void - { - $queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_event'); - $queryBuilder->update('tx_events_domain_model_event'); - - foreach ($migration as $legacyLocationUid => $newLocationUid) { - $finalBuilder = clone $queryBuilder; - $finalBuilder->where($finalBuilder->expr()->eq('location', $finalBuilder->createNamedParameter($legacyLocationUid))); - $finalBuilder->set('location', $newLocationUid); - $finalBuilder->executeStatement(); - } - } -} diff --git a/Classes/Updates/MigrateOldLocations.php b/Classes/Updates/MigrateOldLocations.php deleted file mode 100644 index f5e92a8..0000000 --- a/Classes/Updates/MigrateOldLocations.php +++ /dev/null @@ -1,267 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -namespace WerkraumMedia\Events\Updates; - -use Exception; -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Database\Query\QueryBuilder; -use TYPO3\CMS\Core\DataHandling\DataHandler; -use TYPO3\CMS\Core\Log\Logger; -use TYPO3\CMS\Core\Log\LogManager; -use TYPO3\CMS\Install\Attribute\UpgradeWizard; -use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite; -use TYPO3\CMS\Install\Updates\UpgradeWizardInterface; - -#[UpgradeWizard(MigrateOldLocations::class)] -class MigrateOldLocations implements UpgradeWizardInterface -{ - private readonly Logger $logger; - - private array $uidsForTranslation = []; - - public function __construct( - private readonly ConnectionPool $connectionPool, - private readonly DataHandler $dataHandler, - LogManager $logManager - ) { - $this->logger = $logManager->getLogger(self::class); - } - - public function getTitle(): string - { - return 'Migrate EXT:event location data.'; - } - - public function getDescription(): string - { - return 'Checks for legacy location data stored within events and will create dedicated location records and relations.'; - } - - public function updateNecessary(): bool - { - return $this->hasOldColumns() - && $this->getQueryBuilder()->count('*')->executeQuery()->fetchOne() > 0; - } - - public function executeUpdate(): bool - { - $result = $this->getQueryBuilder()->executeQuery()->iterateAssociative(); - foreach ($result as $eventRecord) { - $this->logger->info('Updating event record.', ['record' => $eventRecord]); - $eventRecord['location'] = $this->getLocationUid($eventRecord); - $this->uidsForTranslation[$eventRecord['uid'] . '-' . $eventRecord['sys_language_uid']] = $eventRecord['location']; - $this->updateEvent($eventRecord); - } - return true; - } - - private function getLocationUid(array $event): int - { - $existingUid = $this->getExitingLocationUid($event); - if ($existingUid > 0) { - $this->logger->info('Location already exists', ['uid' => $existingUid, 'event' => $event]); - return $existingUid; - } - - return $this->createLocation($event); - } - - private function getExitingLocationUid(array $event): int - { - $columns = [ - 'sys_language_uid', - 'name', - 'street', - 'district', - 'city', - 'zip', - 'country', - 'phone', - 'latitude', - 'longitude', - ]; - $qb = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_location'); - $qb->select('uid', 'l10n_parent'); - $qb->from('tx_events_domain_model_location'); - foreach ($columns as $column) { - $qb->andWhere($qb->expr()->eq($column, $qb->createNamedParameter($event[$column]))); - } - - $uids = $qb->executeQuery()->fetchAssociative(); - if (is_bool($uids)) { - return 0; - } - - return $uids['l10n_parent'] ?: $uids['uid']; - } - - private function createLocation(array $event): int - { - $this->logger->info('Location will be created.', ['event' => $event]); - - $columnsToMap = [ - 'pid', - 'sys_language_uid', - 'name', - 'street', - 'district', - 'city', - 'zip', - 'country', - 'phone', - 'latitude', - 'longitude', - ]; - $record = []; - - foreach ($columnsToMap as $columnName) { - $record[$columnName] = $event[$columnName]; - } - $recordUid = 'NEW12121'; - $l10nParentUid = $this->uidsForTranslation[$event['l10n_parent'] . '-0'] ?? 0; - $dataHandler = clone $this->dataHandler; - - if ($event['sys_language_uid'] > 0 && $l10nParentUid > 0) { - $this->logger->info('Foreign language, create translation.', [ - 'l10nParentUid' => $l10nParentUid, - 'event' => $event, - ]); - - $dataHandler->start([], [ - 'tx_events_domain_model_location' => [ - $l10nParentUid => [ - 'localize' => $event['sys_language_uid'], - ], - ], - ]); - $dataHandler->process_cmdmap(); - $recordUid = $dataHandler->copyMappingArray_merged['tx_events_domain_model_location'][$l10nParentUid] ?? 0; - } - - $this->logger->info('Create or update loation.', [ - 'recordUid' => $recordUid, - 'l10nParentUid' => $l10nParentUid, - 'event' => $event, - 'record' => $record, - ]); - - $dataHandler->start([ - 'tx_events_domain_model_location' => [ - $recordUid => $record, - ], - ], []); - $dataHandler->process_datamap(); - - $uid = $dataHandler->substNEWwithIDs[$recordUid] ?? 0; - $this->logger->info('Created or updated location.', [ - 'uid' => $uid, - ]); - if ($uid > 0) { - return $uid; - } - if ($l10nParentUid > 0) { - return $l10nParentUid; - } - - throw new Exception('Could not create location: ' . implode(', ', $dataHandler->errorLog), 1672916613); - } - - private function updateEvent(array $event): void - { - $this->connectionPool - ->getConnectionForTable('tx_events_domain_model_event') - ->update( - 'tx_events_domain_model_event', - ['location' => $event['location']], - ['uid' => $event['uid']] - ) - ; - } - - private function getQueryBuilder(): QueryBuilder - { - $columns = $this->columnsToFetch(); - - $qb = $this->connectionPool->getQueryBuilderForTable('tx_events_domain_model_event'); - $qb->getRestrictions()->removeAll(); - $qb->select(...$columns); - $qb->addSelect('uid', 'pid', 'sys_language_uid', 'l10n_parent'); - $qb->from('tx_events_domain_model_event'); - foreach ($columns as $columnName) { - $qb->orWhere($qb->expr()->neq($columnName, $qb->createNamedParameter(''))); - } - $qb->orderBy('sys_language_uid', 'ASC'); - $qb->addOrderBy('l10n_parent', 'ASC'); - $qb->addOrderBy('uid', 'ASC'); - - return $qb; - } - - public function getIdentifier(): string - { - return self::class; - } - - public function getPrerequisites(): array - { - return [ - DatabaseUpdatedPrerequisite::class, - ]; - } - - private function hasOldColumns(): bool - { - $schema = $this->connectionPool - ->getConnectionForTable('tx_events_domain_model_event') - ->getSchemaInformation() - ->introspectTable('tx_events_domain_model_event') - ; - - foreach ($this->columnsToFetch() as $column) { - if ($schema->hasColumn($column) === false) { - return false; - } - } - - return true; - } - - /** - * @return string[] - */ - private function columnsToFetch(): array - { - return [ - 'name', - 'street', - 'district', - 'city', - 'zip', - 'country', - 'phone', - 'latitude', - 'longitude', - ]; - } -} diff --git a/Classes/Updates/MigratePluginsFromListToCtype.php b/Classes/Updates/MigratePluginsFromListToCtype.php deleted file mode 100644 index 4c25cb1..0000000 --- a/Classes/Updates/MigratePluginsFromListToCtype.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -namespace WerkraumMedia\Events\Updates; - -use TYPO3\CMS\Install\Attribute\UpgradeWizard; -use TYPO3\CMS\Install\Updates\AbstractListTypeToCTypeUpdate; - -// TODO: typo3/cms-core:14.0 Remove condition as this class is provided since 13. -if (class_exists(AbstractListTypeToCTypeUpdate::class) === false) { - final class MigratePluginsFromListToCtype - { - } - return; -} - -#[UpgradeWizard(MigratePluginsFromListToCtype::class)] -final class MigratePluginsFromListToCtype extends AbstractListTypeToCTypeUpdate -{ - protected function getListTypeToCTypeMapping(): array - { - return [ - 'events_datelist' => 'events_datelist', - 'events_datesearch' => 'events_datesearch', - 'events_dateshow ' => 'events_dateshow', - 'events_selected ' => 'events_selected', - ]; - } - - public function getTitle(): string - { - return 'Migrate EXT:events content elements.'; - } - - public function getDescription(): string - { - return 'Migrate CType from list to dedicated plugins.'; - } -} diff --git a/Configuration/FlexForms/DateList.xml b/Configuration/FlexForms/DateList.xml deleted file mode 100644 index 886bdd7..0000000 --- a/Configuration/FlexForms/DateList.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - Options - array - - - 1 - - - select - selectSingle - - - Start - start - - - End - end - - - - - - - 1 - - - select - selectSingle - - - - Ascending - - ASC - - - - Descending - - DESC - - - ASC - - - - - 1 - - - input - 10 - 30 - trim - - - - - 1 - - - check - 0 - - - - - 1 - - - check - 0 - - - - - 1 - - - check - 0 - - - - - 1 - - - group - pages - 1 - 1 - 0 - 1 - - - - - - - - Template - array - - - 1 - - - select - selectSingle - - - Default - default - - - Custom - costum - - - Table - table - - - Grid - grid - - - default - - - - - - - - Regions & Categories - array - - - - - select - selectSingle - - - Alle - - - - tx_events_domain_model_region - AND tx_events_domain_model_region.deleted = 0 AND tx_events_domain_model_region.hidden = 0 - 1 - 0 - 1 - - - - - 1 - - - select - selectSingle - - - And - 0 - - - Or - 1 - - - 0 - - - - - 1 - - - select - selectTree - 20 - sys_category - AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC - 1 - tree - 8 - - - 1 - 1 - - parent - - - - - - 1 - - - check - 0 - - - - - - - diff --git a/Configuration/FlexForms/DateSearch.xml b/Configuration/FlexForms/DateSearch.xml deleted file mode 100644 index 9f1d25b..0000000 --- a/Configuration/FlexForms/DateSearch.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Options - array - - - 1 - - - group - pages - 1 - 1 - 0 - 1 - - - - 1 - - - check - 0 - - - - - - - diff --git a/Configuration/FlexForms/DateShow.xml b/Configuration/FlexForms/DateShow.xml deleted file mode 100644 index 998671e..0000000 --- a/Configuration/FlexForms/DateShow.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Options - array - - - 1 - - - group - pages - 1 - 1 - 0 - 1 - - - - - - - - Template - array - - - 1 - - - select - - - Default - default - - - Custom - costum - - - default - - - - - - - diff --git a/Configuration/FlexForms/Selected.xml b/Configuration/FlexForms/Selected.xml deleted file mode 100644 index 43cb7e4..0000000 --- a/Configuration/FlexForms/Selected.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - array - - - 1 - - - group - tx_events_domain_model_event - 1 - 1 - - - - - - - diff --git a/Configuration/Routing.yaml b/Configuration/Routing.yaml deleted file mode 100644 index 0473f4d..0000000 --- a/Configuration/Routing.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Legacy, used for Plugins -routeEnhancers: - EventsDateShow: - type: Extbase - extension: Events - plugin: DateShow - defaultController: 'Date::show' - routes: - - - routePath: '/{date}' - _controller: 'Date::show' - aspects: - date: - type: PersistedAliasMapper - tableName: tx_events_domain_model_date - routeFieldName: slug - EventsPagination: - type: Plugin - namespace: 'events_search' - routePath: '/{localizedPage}-{currentPage}' - aspects: - localizedPage: - type: LocaleModifier - default: 'page' - localeMap: - - locale: 'de*' - value: 'seite' diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 4a68e09..86ac83d 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -37,12 +37,6 @@ services: identifier: 'WerkraumMediaEventsAddSpecialPropertiesToDate' event: TYPO3\CMS\Extbase\Event\Persistence\AfterObjectThawedEvent - WerkraumMedia\Events\Updates\MigrateDuplicateLocations: - public: true - - WerkraumMedia\Events\Updates\MigrateOldLocations: - public: true - WerkraumMedia\Events\Caching\PageCacheTimeout: arguments: '$runtimeCache': '@cache.runtime' diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php deleted file mode 100644 index f22ec9a..0000000 --- a/Configuration/TCA/Overrides/tt_content.php +++ /dev/null @@ -1,70 +0,0 @@ - -
- -
- \ No newline at end of file diff --git a/Resources/Private/Partials/Date/ListDefault.html b/Resources/Private/Partials/Date/ListDefault.html deleted file mode 100644 index 396cd66..0000000 --- a/Resources/Private/Partials/Date/ListDefault.html +++ /dev/null @@ -1,37 +0,0 @@ - -
- -
- -
-
- {date.event.region.title} | - - - {date.start} - - - {date.start} - - -

{date.event.title}

-

{date.event.teaser}

-
-
-
-
-
- diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html deleted file mode 100644 index 8636a8e..0000000 --- a/Resources/Private/Partials/Date/ListTable.html +++ /dev/null @@ -1,60 +0,0 @@ - - - -
-
- - {date.start} - - {date.start} - {date.start} - {date.event.region.title}
-
-
- - -

- -

-
-

- - {date.event.title} - -

-

{date.event.teaser}

- {date.event.details} -
-
- - - - - - - - - Dummy - - - - -
-
- - - - -
-
-
-
- - {f:render(partial: 'Pagination', arguments: { - pagination: pagination - })} - - diff --git a/Resources/Private/Partials/Event/SearchForm.html b/Resources/Private/Partials/Event/SearchForm.html deleted file mode 100644 index 34f9236..0000000 --- a/Resources/Private/Partials/Event/SearchForm.html +++ /dev/null @@ -1,14 +0,0 @@ - - -
-
-
- -
- - -
-
-
-
-
diff --git a/Resources/Private/Partials/Pagination.html b/Resources/Private/Partials/Pagination.html deleted file mode 100644 index 48f68e2..0000000 --- a/Resources/Private/Partials/Pagination.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - diff --git a/Resources/Private/Templates/Date/List.html b/Resources/Private/Templates/Date/List.html deleted file mode 100644 index 4f215f8..0000000 --- a/Resources/Private/Templates/Date/List.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - {f:render(partial: 'Date/ListTable', arguments: _all)} - - - {f:render(partial: 'Date/ListDefault', arguments: _all)} - - - - - diff --git a/Resources/Private/Templates/Date/Search.html b/Resources/Private/Templates/Date/Search.html deleted file mode 100644 index c3945fd..0000000 --- a/Resources/Private/Templates/Date/Search.html +++ /dev/null @@ -1,75 +0,0 @@ - - - -
-
- -
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
-
- -
-
-
- - -
-
- - -
-
- - -
-
-
-
-
-
-
- - -
- -
-
- - -
-
-
-
-
- -
- -
-
-
-
-
- diff --git a/Resources/Private/Templates/Date/Show.html b/Resources/Private/Templates/Date/Show.html deleted file mode 100644 index 4e7014c..0000000 --- a/Resources/Private/Templates/Date/Show.html +++ /dev/null @@ -1,74 +0,0 @@ - - - -
-
- - - - - - Dummy - - -
-
- -

- -

-
-

- {date.start} - {date.start} - {date.start} Uhr -

-

{date.event.title}

-

{date.event.teaser}

- {date.event.details} -
-
-
-
- -
-
-
-
-

Preis:
- - - {date.event.priceInfo} - - - Keine Information - - -

- - -

Weitere Informationen:
- Website -

-
-
-
-

Veranstaltungsort:
- {date.event.location.name}
- {date.event.location.street}
- {date.event.location.zip} {date.event.location.city}
- {date.event.location.phone}
-

-
-
-

Veranstalter:
- {date.event.organizer.name}
- {date.event.organizer.street}
- {date.event.organizer.zip} {date.event.organizer.city}
- {date.event.organizer.phone}
- Website -

-
-
-
- diff --git a/Resources/Private/Templates/Date/Teaser.html b/Resources/Private/Templates/Date/Teaser.html deleted file mode 100644 index 17e5d4f..0000000 --- a/Resources/Private/Templates/Date/Teaser.html +++ /dev/null @@ -1,50 +0,0 @@ - - - -
- -
- - - - -
-
- {date.event.region.title} | - - - {date.start} - - - {date.start} - - -

{date.event.title}

-

{date.event.teaser}

- - - Highlight - - -
-
-
-
-
-
- diff --git a/Resources/Private/Templates/Event/List.html b/Resources/Private/Templates/Event/List.html deleted file mode 100644 index 50707dd..0000000 --- a/Resources/Private/Templates/Event/List.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - -
- -
- -
-
- {event.region.title} -

{event.title}

-

{event.teaser}

-
-
-
-
-
-
- diff --git a/Resources/Private/Templates/Event/Search.html b/Resources/Private/Templates/Event/Search.html deleted file mode 100644 index 111d621..0000000 --- a/Resources/Private/Templates/Event/Search.html +++ /dev/null @@ -1,29 +0,0 @@ - - -
- -
- -
-
- {event.region.title} -

{event.title}

-

{event.teaser}

-
-
-
-
-
diff --git a/Resources/Private/Templates/Event/Show.html b/Resources/Private/Templates/Event/Show.html deleted file mode 100644 index cc48061..0000000 --- a/Resources/Private/Templates/Event/Show.html +++ /dev/null @@ -1,37 +0,0 @@ - - - -
-
- - - - - - - - - Dummy - - - -
-
-

{event.title}

-

{event.teaser}

- {event.details} -

{event.price_info}

- -
-
-

Veranstaltungsort:
- {event.location.street}
- {event.location.zip} {event.location.city}
-

-
-
- -
-
-
- diff --git a/Resources/Private/Templates/Event/Teaser.html b/Resources/Private/Templates/Event/Teaser.html deleted file mode 100644 index 396e6d9..0000000 --- a/Resources/Private/Templates/Event/Teaser.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - -
- -
- -
-
- {event.region.title} -

{event.title}

-

{event.teaser}

-
-
-
-
-
-
- diff --git a/Tests/Functional/AbstractFunctionalTestCase.php b/Tests/Functional/AbstractFunctionalTestCase.php index bbe3bf8..62d5489 100644 --- a/Tests/Functional/AbstractFunctionalTestCase.php +++ b/Tests/Functional/AbstractFunctionalTestCase.php @@ -133,7 +133,7 @@ abstract class AbstractFunctionalTestCase extends FunctionalTestCase array $argumentsAndOptions = ['configurationUid' => '1'], string $command = ImportDestinationDataViaConfigruationCommand::class ): CommandTester { - GeneralUtility::setContainer($this->getcontainer()); + GeneralUtility::setContainer($this->getContainer()); $subject = $this->get($command); self::assertInstanceOf(Command::class, $subject); diff --git a/Tests/Functional/Frontend/AbstractFrontendTestCase.php b/Tests/Functional/Frontend/AbstractFrontendTestCase.php new file mode 100644 index 0000000..8951f1b --- /dev/null +++ b/Tests/Functional/Frontend/AbstractFrontendTestCase.php @@ -0,0 +1,46 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +namespace WerkraumMedia\Events\Tests\Functional\Frontend; + +use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; + +abstract class AbstractFrontendTestCase extends AbstractFunctionalTestCase +{ + protected function setUp(): void + { + $this->coreExtensionsToLoad = [ + 'seo', + ]; + + $this->testExtensionsToLoad = [ + ...$this->testExtensionsToLoad, + 'typo3conf/ext/events/Tests/Functional/Frontend/Fixtures/Extensions/example/', + ]; + + parent::setUp(); + + $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SiteStructure.php'); + $this->setUpFrontendRendering(); + } +} diff --git a/Tests/Functional/Frontend/CacheTest.php b/Tests/Functional/Frontend/CacheTest.php index 1f1bd1c..afe8c3a 100644 --- a/Tests/Functional/Frontend/CacheTest.php +++ b/Tests/Functional/Frontend/CacheTest.php @@ -33,15 +33,11 @@ use TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend; use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; -use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; -class CacheTest extends AbstractFunctionalTestCase +final class CacheTest extends AbstractFrontendTestCase { protected function setUp(): void { - $this->testExtensionsToLoad = [ - 'typo3conf/ext/events/Tests/Functional/Frontend/Fixtures/Extensions/example', - ]; $this->configurationToUseInTestInstance = [ 'SYS' => [ // Combined with flushCaches. @@ -64,14 +60,12 @@ class CacheTest extends AbstractFunctionalTestCase $this->get(CacheManager::class)->flushCaches(); - $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SiteStructure.php'); (new PhpDataSet())->import(['tt_content' => [[ 'uid' => '1', 'pid' => '1', 'CType' => 'events_datelisttest', 'header' => 'All Dates', ]]]); - $this->setUpFrontendRendering(); } #[Test] diff --git a/Tests/Functional/Frontend/DatesTest.php b/Tests/Functional/Frontend/DatesTest.php index 457ee23..ccaedee 100644 --- a/Tests/Functional/Frontend/DatesTest.php +++ b/Tests/Functional/Frontend/DatesTest.php @@ -27,22 +27,9 @@ use PHPUnit\Framework\Attributes\Test; use Psr\Http\Message\ResponseInterface; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use WerkraumMedia\Events\Frontend\Dates; -use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; -class DatesTest extends AbstractFunctionalTestCase +final class DatesTest extends AbstractFrontendTestCase { - protected function setUp(): void - { - $this->coreExtensionsToLoad = [ - 'seo', - ]; - - parent::setUp(); - - $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SiteStructure.php'); - $this->setUpFrontendRendering(); - } - /** * Covers issue https://redmine.werkraum-media.de/issues/10075. * Editors can disable events. Dates will still be available. @@ -74,7 +61,7 @@ class DatesTest extends AbstractFunctionalTestCase $request = new InternalRequest('https://example.com/'); $request = $request->withPageId(1); $request = $request->withQueryParameters([ - 'events_search[search][start]' => '2023-02-16', + 'tx_events_datelisttest[search][start]' => '2023-02-16', ]); $response = $this->executeFrontendSubRequest($request); @@ -100,7 +87,7 @@ class DatesTest extends AbstractFunctionalTestCase $request = new InternalRequest('https://example.com/'); $request = $request->withPageId(1); $request = $request->withQueryParameters([ - 'events_search[search][end]' => '2023-02-17', + 'tx_events_datelisttest[search][end]' => '2023-02-17', ]); $response = $this->executeFrontendSubRequest($request); @@ -131,8 +118,8 @@ class DatesTest extends AbstractFunctionalTestCase $request = new InternalRequest('https://example.com/'); $request = $request->withPageId(1); $request = $request->withQueryParameters([ - 'events_search[search][start]' => '2023-02-16', - 'events_search[search][end]' => '2023-02-17', + 'tx_events_datelisttest[search][start]' => '2023-02-16', + 'tx_events_datelisttest[search][end]' => '2023-02-17', ]); $response = $this->executeFrontendSubRequest($request); @@ -248,7 +235,7 @@ class DatesTest extends AbstractFunctionalTestCase { $request = new InternalRequest('https://example.com/'); $request = $request->withPageId(1); - $request = $request->withQueryParameter('tx_events_dateshow[date]', '1'); + $request = $request->withQueryParameter('tx_events_dateshowtest[date]', '1'); return $this->executeFrontendSubRequest($request); } diff --git a/Tests/Functional/Frontend/DatesTestFixtures/DateMetaTags.php b/Tests/Functional/Frontend/DatesTestFixtures/DateMetaTags.php index 610be32..f6a9120 100644 --- a/Tests/Functional/Frontend/DatesTestFixtures/DateMetaTags.php +++ b/Tests/Functional/Frontend/DatesTestFixtures/DateMetaTags.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_dateshow', + 'CType' => 'events_dateshowtest', 'header' => 'Singleview', ], ], diff --git a/Tests/Functional/Frontend/DatesTestFixtures/DateOpenGraphTags.php b/Tests/Functional/Frontend/DatesTestFixtures/DateOpenGraphTags.php index dc6aad1..bdf0dba 100644 --- a/Tests/Functional/Frontend/DatesTestFixtures/DateOpenGraphTags.php +++ b/Tests/Functional/Frontend/DatesTestFixtures/DateOpenGraphTags.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_dateshow', + 'CType' => 'events_dateshowtest', 'header' => 'Singleview', ], ], diff --git a/Tests/Functional/Frontend/DatesTestFixtures/DatePageTitle.php b/Tests/Functional/Frontend/DatesTestFixtures/DatePageTitle.php index b0e07c7..d76f995 100644 --- a/Tests/Functional/Frontend/DatesTestFixtures/DatePageTitle.php +++ b/Tests/Functional/Frontend/DatesTestFixtures/DatePageTitle.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_dateshow', + 'CType' => 'events_dateshowtest', 'header' => 'Singleview', ], ], diff --git a/Tests/Functional/Frontend/DatesTestFixtures/DateSocialMediaTags.php b/Tests/Functional/Frontend/DatesTestFixtures/DateSocialMediaTags.php index 88269de..bc7a763 100644 --- a/Tests/Functional/Frontend/DatesTestFixtures/DateSocialMediaTags.php +++ b/Tests/Functional/Frontend/DatesTestFixtures/DateSocialMediaTags.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_dateshow', + 'CType' => 'events_dateshowtest', 'header' => 'Singleview', ], ], diff --git a/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.php b/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.php index 27002f1..20ffd6b 100644 --- a/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.php +++ b/Tests/Functional/Frontend/DatesTestFixtures/Returns404IfEventIsHidden.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_dateshow', + 'CType' => 'events_dateshowtest', 'header' => 'Singleview', ], ], diff --git a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.php b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.php index 91ef7af..8ad776e 100644 --- a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.php +++ b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsDateWithinTimeSpan.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_datelist', + 'CType' => 'events_datelisttest', 'header' => 'All Dates', ], ], diff --git a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.php b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.php index 147f48d..f9cf062 100644 --- a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.php +++ b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsOnlyDatesWithAvailableEventByDemand.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_datelist', + 'CType' => 'events_datelisttest', 'header' => 'All Dates', ], ], diff --git a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsUpcomingDates.php b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsUpcomingDates.php index fec3e8c..3013f58 100644 --- a/Tests/Functional/Frontend/DatesTestFixtures/ReturnsUpcomingDates.php +++ b/Tests/Functional/Frontend/DatesTestFixtures/ReturnsUpcomingDates.php @@ -7,7 +7,7 @@ return [ [ 'uid' => 1, 'pid' => 1, - 'CType' => 'events_datelist', + 'CType' => 'events_datelisttest', 'header' => 'Upcoming Dates', ], ], diff --git a/Tests/Functional/Frontend/EventsTest.php b/Tests/Functional/Frontend/EventsTest.php index b120ac4..ce3d1d9 100644 --- a/Tests/Functional/Frontend/EventsTest.php +++ b/Tests/Functional/Frontend/EventsTest.php @@ -26,25 +26,9 @@ namespace WerkraumMedia\Events\Tests\Functional\Frontend; use PHPUnit\Framework\Attributes\Test; use Psr\Http\Message\ResponseInterface; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; -use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; -class EventsTest extends AbstractFunctionalTestCase +final class EventsTest extends AbstractFrontendTestCase { - protected function setUp(): void - { - $this->testExtensionsToLoad = [ - 'typo3conf/ext/events/Tests/Functional/Frontend/Fixtures/Extensions/example', - ]; - $this->coreExtensionsToLoad = [ - 'seo', - ]; - - parent::setUp(); - - $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SiteStructure.php'); - $this->setUpFrontendRendering(); - } - #[Test] public function addsMetaTags(): void { @@ -103,7 +87,7 @@ class EventsTest extends AbstractFunctionalTestCase { $request = new InternalRequest('https://example.com/'); $request = $request->withPageId(1); - $request = $request->withQueryParameter('tx_events_eventshow[event]', '1'); + $request = $request->withQueryParameter('tx_events_eventshowtest[event]', '1'); return $this->executeFrontendSubRequest($request); } diff --git a/Tests/Functional/Frontend/EventsTestFixtures/EventMetaTags.php b/Tests/Functional/Frontend/EventsTestFixtures/EventMetaTags.php index 06950a1..b37d74f 100644 --- a/Tests/Functional/Frontend/EventsTestFixtures/EventMetaTags.php +++ b/Tests/Functional/Frontend/EventsTestFixtures/EventMetaTags.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_eventshow', + 'CType' => 'events_eventshowtest', 'header' => 'Singleview', ], ], diff --git a/Tests/Functional/Frontend/EventsTestFixtures/EventOpenGraphTags.php b/Tests/Functional/Frontend/EventsTestFixtures/EventOpenGraphTags.php index 43baf91..22a447a 100644 --- a/Tests/Functional/Frontend/EventsTestFixtures/EventOpenGraphTags.php +++ b/Tests/Functional/Frontend/EventsTestFixtures/EventOpenGraphTags.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_eventshow', + 'CType' => 'events_eventshowtest', 'header' => 'Singleview', ], ], diff --git a/Tests/Functional/Frontend/EventsTestFixtures/EventPageTitle.php b/Tests/Functional/Frontend/EventsTestFixtures/EventPageTitle.php index 65c25af..877f917 100644 --- a/Tests/Functional/Frontend/EventsTestFixtures/EventPageTitle.php +++ b/Tests/Functional/Frontend/EventsTestFixtures/EventPageTitle.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_eventshow', + 'CType' => 'events_eventshowtest', 'header' => 'Singleview', ], ], diff --git a/Tests/Functional/Frontend/EventsTestFixtures/EventSocialMediaTags.php b/Tests/Functional/Frontend/EventsTestFixtures/EventSocialMediaTags.php index cc7d1cc..b6dd4f0 100644 --- a/Tests/Functional/Frontend/EventsTestFixtures/EventSocialMediaTags.php +++ b/Tests/Functional/Frontend/EventsTestFixtures/EventSocialMediaTags.php @@ -7,7 +7,7 @@ return [ 0 => [ 'uid' => '1', 'pid' => '1', - 'CType' => 'events_eventshow', + 'CType' => 'events_eventshowtest', 'header' => 'Singleview', ], ], diff --git a/Tests/Functional/Frontend/FilterTest.php b/Tests/Functional/Frontend/FilterTest.php index c64c201..05fa179 100644 --- a/Tests/Functional/Frontend/FilterTest.php +++ b/Tests/Functional/Frontend/FilterTest.php @@ -6,18 +6,9 @@ namespace WerkraumMedia\Events\Tests\Functional\Frontend; use PHPUnit\Framework\Attributes\Test; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; -use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; -class FilterTest extends AbstractFunctionalTestCase +final class FilterTest extends AbstractFrontendTestCase { - protected function setUp(): void - { - parent::setUp(); - - $this->importPHPDataSet(__DIR__ . '/Fixtures/Database/SiteStructure.php'); - $this->setUpFrontendRendering(); - } - #[Test] public function canFilterByASingleLocationViaFlexform(): void { diff --git a/Tests/Functional/Frontend/Fixtures/Database/FilterByASingleLocationViaFlexform.php b/Tests/Functional/Frontend/Fixtures/Database/FilterByASingleLocationViaFlexform.php index 57dfb84..44cd685 100644 --- a/Tests/Functional/Frontend/Fixtures/Database/FilterByASingleLocationViaFlexform.php +++ b/Tests/Functional/Frontend/Fixtures/Database/FilterByASingleLocationViaFlexform.php @@ -7,7 +7,7 @@ return [ [ 'pid' => '1', 'uid' => '1', - 'CType' => 'events_datelist', + 'CType' => 'events_datelisttest', 'header' => 'Kino Events', 'pi_flexform' => ' diff --git a/Tests/Functional/Frontend/Fixtures/Database/FilterByTwoLocationsViaFlexform.php b/Tests/Functional/Frontend/Fixtures/Database/FilterByTwoLocationsViaFlexform.php index ea24c42..a22a704 100644 --- a/Tests/Functional/Frontend/Fixtures/Database/FilterByTwoLocationsViaFlexform.php +++ b/Tests/Functional/Frontend/Fixtures/Database/FilterByTwoLocationsViaFlexform.php @@ -7,7 +7,7 @@ return [ [ 'pid' => '1', 'uid' => '1', - 'CType' => 'events_datelist', + 'CType' => 'events_datelisttest', 'header' => 'Kino Events', 'pi_flexform' => ' diff --git a/Tests/Functional/Frontend/Fixtures/Database/FilterDatesByParentLocationViaFlexform.php b/Tests/Functional/Frontend/Fixtures/Database/FilterDatesByParentLocationViaFlexform.php index ca2385e..0b96b4d 100644 --- a/Tests/Functional/Frontend/Fixtures/Database/FilterDatesByParentLocationViaFlexform.php +++ b/Tests/Functional/Frontend/Fixtures/Database/FilterDatesByParentLocationViaFlexform.php @@ -7,7 +7,7 @@ return [ [ 'pid' => '1', 'uid' => '1', - 'CType' => 'events_datelist', + 'CType' => 'events_datelisttest', 'header' => 'Kino Events', 'pi_flexform' => ' diff --git a/Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Date/List.html b/Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Date/List.html new file mode 100644 index 0000000..c510783 --- /dev/null +++ b/Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Date/List.html @@ -0,0 +1,35 @@ + + +
+ +
+ +
+
+ {date.event.region.title} | + + + {date.start} + + + {date.start} + + +

{date.event.title}

+

{date.event.teaser}

+
+
+
+
+
+ + diff --git a/Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Date/Show.html b/Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Date/Show.html new file mode 100644 index 0000000..eb85541 --- /dev/null +++ b/Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Date/Show.html @@ -0,0 +1,73 @@ + + +
+
+ + + + + + Dummy + + +
+
+ +

+ +

+
+

+ {date.start} + {date.start} + {date.start} Uhr +

+

{date.event.title}

+

{date.event.teaser}

+ {date.event.details} +
+
+
+
+ +
+
+
+
+

Preis:
+ + + {date.event.priceInfo} + + + Keine Information + + +

+ + +

Weitere Informationen:
+ Website +

+
+
+
+

Veranstaltungsort:
+ {date.event.location.name}
+ {date.event.location.street}
+ {date.event.location.zip} {date.event.location.city}
+ {date.event.location.phone}
+

+
+
+

Veranstalter:
+ {date.event.organizer.name}
+ {date.event.organizer.street}
+ {date.event.organizer.zip} {date.event.organizer.city}
+ {date.event.organizer.phone}
+ Website +

+
+
+ + diff --git a/Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Event/Show.html b/Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Event/Show.html new file mode 100644 index 0000000..1e37a36 --- /dev/null +++ b/Tests/Functional/Frontend/Fixtures/Extensions/example/Resources/Private/Templates/Event/Show.html @@ -0,0 +1,36 @@ + + +
+
+ + + + + + + + + Dummy + + + +
+
+

{event.title}

+

{event.teaser}

+ {event.details} +

{event.price_info}

+ +
+
+

Veranstaltungsort:
+ {event.location.street}
+ {event.location.zip} {event.location.city}
+

+
+
+ +
+
+ + diff --git a/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_localconf.php b/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_localconf.php index 19900d1..5468e62 100644 --- a/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_localconf.php +++ b/Tests/Functional/Frontend/Fixtures/Extensions/example/ext_localconf.php @@ -16,7 +16,15 @@ ExtensionUtility::configurePlugin( ExtensionUtility::configurePlugin( 'Events', - 'EventShow', + 'DateShowTest', + [DateController::class => 'show'], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT, +); + +ExtensionUtility::configurePlugin( + 'Events', + 'EventShowTest', [EventController::class => 'show'], [], ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT, diff --git a/Tests/Functional/Frontend/Fixtures/TypoScript/Rendering.typoscript b/Tests/Functional/Frontend/Fixtures/TypoScript/Rendering.typoscript index 3201d00..cbd8234 100644 --- a/Tests/Functional/Frontend/Fixtures/TypoScript/Rendering.typoscript +++ b/Tests/Functional/Frontend/Fixtures/TypoScript/Rendering.typoscript @@ -32,6 +32,18 @@ plugin.tx_events { storagePid = 2 } + view { + templateRootPaths { + 0 = EXT:example/Resources/Private/Templates/ + } + partialRootPaths { + 0 = EXT:example/Resources/Private/Partials/ + } + layoutRootPaths { + 0 = EXT:example/Resources/Private/Layouts/ + } + } + settings { sortByDate = start sortOrder = ASC diff --git a/Tests/Functional/Import/DestinationDataTest/ImportsAllConfigurationTest.php b/Tests/Functional/Import/DestinationDataTest/ImportsAllConfigurationTest.php index 47b07dd..dcab026 100644 --- a/Tests/Functional/Import/DestinationDataTest/ImportsAllConfigurationTest.php +++ b/Tests/Functional/Import/DestinationDataTest/ImportsAllConfigurationTest.php @@ -51,7 +51,7 @@ class ImportsAllConfigurationTest extends AbstractTestCase self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[2]['request']->getUri()); self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[3]['request']->getUri()); - self::assertSame('http://meta.et4.de/rest.ashx/search/?experience=beispielstadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json&q=name%3A%22Beispiel%22', (string)$requests[0]['request']->getUri()); + self::assertSame('http://meta.et4.de/rest.ashx/search/?experience=anderestadt&licensekey=example-license&type=Event&mode=next_months%2C12&limit=3&template=ET2014A.json&q=name%3A%22Beispiel2%22', (string)$requests[4]['request']->getUri()); self::assertSame('https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', (string)$requests[5]['request']->getUri()); self::assertSame('https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', (string)$requests[6]['request']->getUri()); self::assertSame('https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', (string)$requests[7]['request']->getUri()); diff --git a/Tests/Functional/Updates/Assertions/MigrateDuplicateLocations.php b/Tests/Functional/Updates/Assertions/MigrateDuplicateLocations.php deleted file mode 100644 index 53ebbf1..0000000 --- a/Tests/Functional/Updates/Assertions/MigrateDuplicateLocations.php +++ /dev/null @@ -1,61 +0,0 @@ - [ - [ - 'uid' => 1, - 'pid' => 0, - 'sys_language_uid' => -1, - 'global_id' => 'a91656ec76732f2b7b72987d11d81d926fa67ea3b2eb4cc6fd75bb2b748da21d', - 'name' => 'Domplatz', - 'street' => '', - 'city' => 'Erfurt', - 'zip' => '99084', - 'district' => 'Altstadt', - 'country' => 'Deutschland', - 'phone' => '', - 'latitude' => '50.977089', - 'longitude' => '11.024878', - ], - [ - 'uid' => 3, - 'pid' => 0, - 'sys_language_uid' => -1, - 'global_id' => '95ca076b77e478cc8eb831f48aacaa608a640034e31da2e11b42da9758c84aaf', - 'name' => 'Wenigemarkt', - 'street' => '', - 'city' => 'Erfurt', - 'zip' => '99084', - 'district' => 'Altstadt', - 'country' => 'Deutschland', - 'phone' => '', - 'latitude' => '50.978500', - 'longitude' => '11.031589', - ], - ], - 'tx_events_domain_model_event' => [ - [ - 'uid' => 1, - 'pid' => 0, - 'title' => 'Abendmahlsgottesdienst', - 'global_id' => 'e_100171396', - 'location' => 1, - ], - [ - 'uid' => 2, - 'pid' => 0, - 'title' => 'Travestie-Revue "Pretty Wo(man)"', - 'global_id' => 'e_100172162', - 'location' => 1, - ], - [ - 'uid' => 3, - 'pid' => 0, - 'title' => 'Abendgebet in englischer Sprache', - 'global_id' => 'e_100172275', - 'location' => 3, - ], - ], -]; diff --git a/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocations.php b/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocations.php deleted file mode 100644 index be0cdfe..0000000 --- a/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocations.php +++ /dev/null @@ -1,76 +0,0 @@ - [ - [ - 'uid' => 1, - 'pid' => 0, - 'sys_language_uid' => -1, - 'global_id' => '21e0561cb967c2b3c7977c367615b97b4176e26302dd77fadb33296cd37fb4b0', - 'name' => 'Domplatz', - 'street' => '', - 'city' => 'Erfurt', - 'zip' => '99084', - 'district' => 'Altstadt', - 'country' => 'Deutschland', - 'phone' => '', - 'latitude' => '50,977089', - 'longitude' => '11,024878', - ], - [ - 'uid' => 2, - 'pid' => 0, - 'sys_language_uid' => -1, - 'global_id' => '1cc57820faf4a3bf6bf8326f2821068f0619f9fc8bcbebd8c6e4c496e38471c7', - 'name' => 'Domplatz', - 'street' => '', - 'city' => 'Erfurt', - 'zip' => '99084', - 'district' => 'Altstadt', - 'country' => 'Deutschland', - 'phone' => '', - 'latitude' => '50.977089', - 'longitude' => '11.024878', - ], - [ - 'uid' => 3, - 'pid' => 0, - 'sys_language_uid' => -1, - 'global_id' => '64d0def98fe304c32c79e6926cac40c8501797158e0e43990c36f7b1fb50c17e', - 'name' => 'Wenigemarkt', - 'street' => '', - 'city' => 'Erfurt', - 'zip' => '99084', - 'district' => 'Altstadt', - 'country' => 'Deutschland', - 'phone' => '', - 'latitude' => '50.9785', - 'longitude' => '11.031589', - ], - ], - 'tx_events_domain_model_event' => [ - [ - 'uid' => 1, - 'pid' => 0, - 'title' => 'Abendmahlsgottesdienst', - 'global_id' => 'e_100171396', - 'location' => 1, - ], - [ - 'uid' => 2, - 'pid' => 0, - 'title' => 'Travestie-Revue "Pretty Wo(man)"', - 'global_id' => 'e_100172162', - 'location' => 2, - ], - [ - 'uid' => 3, - 'pid' => 0, - 'title' => 'Abendgebet in englischer Sprache', - 'global_id' => 'e_100172275', - 'location' => 3, - ], - ], -]; diff --git a/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocationsNoDuplicates.php b/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocationsNoDuplicates.php deleted file mode 100644 index 132b259..0000000 --- a/Tests/Functional/Updates/Fixtures/MigrateDuplicateLocationsNoDuplicates.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - [ - 'uid' => 1, - 'pid' => 0, - 'sys_language_uid' => -1, - 'global_id' => '1cc57820faf4a3bf6bf8326f2821068f0619f9fc8bcbebd8c6e4c496e38471c7', - 'name' => 'Domplatz', - 'street' => '', - 'city' => 'Erfurt', - 'zip' => '99084', - 'district' => 'Altstadt', - 'country' => 'Deutschland', - 'phone' => '', - 'latitude' => '50.977089', - 'longitude' => '11.024878', - ], - [ - 'uid' => 2, - 'pid' => 0, - 'sys_language_uid' => -1, - 'global_id' => '64d0def98fe304c32c79e6926cac40c8501797158e0e43990c36f7b1fb50c17e', - 'name' => 'Wenigemarkt', - 'street' => '', - 'city' => 'Erfurt', - 'zip' => '99084', - 'district' => 'Altstadt', - 'country' => 'Deutschland', - 'phone' => '', - 'latitude' => '50.9785', - 'longitude' => '11.031589', - ], - ], -]; diff --git a/Tests/Functional/Updates/MigrateDuplicateLocationsTest.php b/Tests/Functional/Updates/MigrateDuplicateLocationsTest.php deleted file mode 100644 index bf3fee2..0000000 --- a/Tests/Functional/Updates/MigrateDuplicateLocationsTest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - */ - -namespace WerkraumMedia\Events\Tests\Functional\Updates; - -use PHPUnit\Framework\Attributes\Test; -use PHPUnit\Framework\Attributes\TestDox; -use WerkraumMedia\Events\Tests\Functional\AbstractFunctionalTestCase; -use WerkraumMedia\Events\Updates\MigrateDuplicateLocations; - -#[TestDox('The update wizard to migrate duplicate locations')] -final class MigrateDuplicateLocationsTest extends AbstractFunctionalTestCase -{ - #[Test] - public function canBeCreated(): void - { - $subject = $this->get(MigrateDuplicateLocations::class); - - self::assertInstanceOf(MigrateDuplicateLocations::class, $subject); - } - - #[Test] - public function keepsDataIfNothingToDo(): void - { - $this->importPHPDataSet(__DIR__ . '/Fixtures/MigrateDuplicateLocationsNoDuplicates.php'); - - $subject = $this->get(MigrateDuplicateLocations::class); - - self::assertInstanceOf(MigrateDuplicateLocations::class, $subject); - self::assertTrue($subject->updateNecessary()); - - $this->assertPHPDataSet(__DIR__ . '/Fixtures/MigrateDuplicateLocationsNoDuplicates.php'); - } - - #[Test] - public function migratesDuplicateEntries(): void - { - $this->importPHPDataSet(__DIR__ . '/Fixtures/MigrateDuplicateLocations.php'); - - $subject = $this->get(MigrateDuplicateLocations::class); - - self::assertInstanceOf(MigrateDuplicateLocations::class, $subject); - self::assertTrue($subject->updateNecessary()); - $subject->executeUpdate(); - - $this->assertPHPDataSet(__DIR__ . '/Assertions/MigrateDuplicateLocations.php'); - } -} diff --git a/ext_localconf.php b/ext_localconf.php index c49e7a8..8757af7 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -2,45 +2,9 @@ declare(strict_types=1); -use TYPO3\CMS\Extbase\Utility\ExtensionUtility; -use WerkraumMedia\Events\Controller\DateController; -use WerkraumMedia\Events\Controller\EventController; - defined('TYPO3') || die('Access denied.'); call_user_func(function () { - ExtensionUtility::configurePlugin( - 'Events', - 'DateSearch', - [DateController::class => 'search'], - [DateController::class => 'search'], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT - ); - - ExtensionUtility::configurePlugin( - 'Events', - 'DateList', - [DateController::class => 'list'], - [DateController::class => 'list'], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT - ); - - ExtensionUtility::configurePlugin( - 'Events', - 'DateShow', - [DateController::class => 'show'], - [DateController::class => 'show'], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT - ); - - ExtensionUtility::configurePlugin( - 'Events', - 'Selected', - [EventController::class => 'list'], - [], - ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT - ); - if ( isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category']) === false || is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category']) === false diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0670f6e..89ff1a1 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -104,8 +104,3 @@ parameters: message: "#^Method WerkraumMedia\\\\Events\\\\Service\\\\DestinationDataImportService\\\\FilesAssignment\\:\\:getImages\\(\\) should return TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage\\ but returns TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage\\\\.$#" count: 1 path: Classes/Service/DestinationDataImportService/FilesAssignment.php - - - - message: "#^Method WerkraumMedia\\\\Events\\\\Updates\\\\MigrateOldLocations\\:\\:getExitingLocationUid\\(\\) should return int but returns mixed\\.$#" - count: 1 - path: Classes/Updates/MigrateOldLocations.php