diff --git a/CHANGELOG.md b/CHANGELOG.md index c1ba49ac8..6d74585bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Removed +- Drop icons for categories (#3777) - Drop the unused `SpeakerBagBuilder` (#3780) - Drop unused BE route configuration file (#3742) - Remove the FE editor (#3685, #3686) diff --git a/Classes/Configuration/ListViewConfigurationCheck.php b/Classes/Configuration/ListViewConfigurationCheck.php index 41973fd10..07717cace 100644 --- a/Classes/Configuration/ListViewConfigurationCheck.php +++ b/Classes/Configuration/ListViewConfigurationCheck.php @@ -44,7 +44,6 @@ protected function checkAllConfigurationValues(): void $this->checkLimitListViewToCategories(); $this->checkLimitListViewToPlaces(); $this->checkLimitListViewToOrganizers(); - $this->checkCategoryIconDisplay(); $this->checkSeminarImageSizesForListView(); $this->checkDisplaySearchFormFields(); $this->checkNumberOfYearsInDateFilter(); @@ -208,19 +207,6 @@ private function checkLimitListViewToOrganizers(): void ); } - /** - * @deprecated will be removed in version 6.0.0 in #3370 - */ - private function checkCategoryIconDisplay(): void - { - $this->checkIfSingleInSetNotEmpty( - 'categoriesInListView', - 'This setting determines whether the seminar category is shown, as icon and text, - as text only or as icon only. If this value is not set correctly, the category will only be shown as text.', - ['both', 'text', 'icon'] - ); - } - /** * Checks the settings for the image width and height in the list view. */ diff --git a/Classes/FrontEnd/CategoryList.php b/Classes/FrontEnd/CategoryList.php index 5d632d263..3903fbfde 100644 --- a/Classes/FrontEnd/CategoryList.php +++ b/Classes/FrontEnd/CategoryList.php @@ -7,7 +7,6 @@ use OliverKlee\Seminars\BagBuilder\CategoryBagBuilder; use OliverKlee\Seminars\BagBuilder\EventBagBuilder; use OliverKlee\Seminars\OldModel\LegacyCategory; -use TYPO3\CMS\Core\Resource\FileReference; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -97,11 +96,7 @@ public function createLinkToListViewLimitedByCategory(int $categoryUid, string $ /** * Creates the list of categories for the event list view. * - * Depending on the configuration value, categoriesInListView returns - * either only the titles as comma-separated list, only the icons with the - * title as title attribute or both. - * - * @param array $categoriesToDisplay + * @param array $categoriesToDisplay * * @return string the HTML output, will be empty if $categoriesToDisplay is empty */ @@ -111,56 +106,12 @@ public function createCategoryList(array $categoriesToDisplay): string return ''; } - $categoryUidsFromConfiguration = $this->getConfValueString('categoriesInListView', 's_listView'); $allCategoryLinks = []; - $categorySeparator = ($categoryUidsFromConfiguration !== 'icon') ? ', ' : ' '; - foreach ($categoriesToDisplay as $uid => $categoryData) { - $linkValue = ''; - switch ($categoryUidsFromConfiguration) { - case 'both': - // @deprecated will be removed in version 6.0.0 in #3370 - if ($categoryData['icon'] instanceof FileReference) { - $linkValue = $this->createCategoryIconImage($categoryData) . ' '; - } - $linkValue .= \htmlspecialchars($categoryData['title'], ENT_QUOTES | ENT_HTML5); - break; - case 'icon': - // @deprecated will be removed in version 6.0.0 in #3370 - $linkValue = $this->createCategoryIconImage($categoryData); - if ($linkValue === '') { - $linkValue = \htmlspecialchars($categoryData['title'], ENT_QUOTES | ENT_HTML5); - $categorySeparator = ', '; - } - break; - default: - $linkValue = \htmlspecialchars($categoryData['title'], ENT_QUOTES | ENT_HTML5); - } - $allCategoryLinks[] = $this->createLinkToListViewLimitedByCategory($uid, $linkValue); + $linkText = \htmlspecialchars($categoryData['title'], ENT_QUOTES | ENT_HTML5); + $allCategoryLinks[] = $this->createLinkToListViewLimitedByCategory($uid, $linkText); } - return implode($categorySeparator, $allCategoryLinks); - } - - /** - * Creates the category icon with the icon title as alt text. - * - * @param array{title: string, icon: FileReference|null} $iconData - * - * @return string the icon tag with the given icon, will be empty if no icon was given - * - * @deprecated will be removed in version 6.0.0 in #3370 - */ - private function createCategoryIconImage(array $iconData): string - { - $icon = $iconData['icon']; - if (!$icon instanceof FileReference) { - return ''; - } - - $imageConfiguration = ['file' => $icon->getPublicUrl(), 'titleText' => $iconData['title']]; - $imageWithoutClass = $this->cObj->cObjGetSingle('IMAGE', $imageConfiguration); - - return \str_replace('setMarker('category_icon', ''); foreach ($this->seminar->getCategories() as $category) { $this->setMarker('category_title', \htmlspecialchars($category['title'], ENT_QUOTES | ENT_HTML5)); - // @deprecated will be removed in version 6.0.0 in #3370 - $this->setMarker('category_icon', $this->createCategoryIconImage($category)); $categoryMarker .= $this->getSubpart('SINGLE_CATEGORY'); } $this->setSubpart('SINGLE_CATEGORY', $categoryMarker); @@ -2140,27 +2139,6 @@ private function hideColumnsForAllViewsFromTypoScriptSetup(): void $this->hideColumns($columns); } - /** - * Creates the category icon IMG tag with the icon title as title attribute. - * - * @param array{title: string, icon: FileReference|null} $iconData - * - * @return string the icon IMG tag with the given icon, will be empty if the category has no icon - * - * @deprecated will be removed in version 6.0.0 in #3370 - */ - private function createCategoryIconImage(array $iconData): string - { - $icon = $iconData['icon']; - if (!$icon instanceof FileReference) { - return ''; - } - - $imageConfiguration = ['file' => $icon->getPublicUrl(), 'titleText' => $iconData['title']]; - - return $this->cObj->cObjGetSingle('IMAGE', $imageConfiguration); - } - /** * Sets a heading for speakers, tutors, leaders or partners, * depending on the speakers, tutors, leaders or partners belonging to the current seminar. diff --git a/Classes/Model/Category.php b/Classes/Model/Category.php index 0c0bff0ec..230dc2fd8 100644 --- a/Classes/Model/Category.php +++ b/Classes/Model/Category.php @@ -19,37 +19,6 @@ public function getTitle(): string return $this->getAsString('title'); } - /** - * @return string the file name of the icon (relative to the extension - * upload path) of the category, will be empty if the - * category has no icon - * - * @deprecated will be removed in version 6.0.0 in #3370 - */ - public function getIcon(): string - { - return $this->getAsString('icon'); - } - - /** - * @param string $icon the file name of the icon (relative to the extension upload path) of the category, - * may be empty - * - * @deprecated will be removed in version 6.0.0 in #3370 - */ - public function setIcon(string $icon): void - { - $this->setAsString('icon', $icon); - } - - /** - * @deprecated will be removed in version 6.0.0 in #3370 - */ - public function hasIcon(): bool - { - return $this->hasString('icon'); - } - /** * @return int the single view page, will be 0 if none has been set */ diff --git a/Classes/OldModel/LegacyCategory.php b/Classes/OldModel/LegacyCategory.php index c33aca9c8..1c1c2c15c 100644 --- a/Classes/OldModel/LegacyCategory.php +++ b/Classes/OldModel/LegacyCategory.php @@ -4,8 +4,6 @@ namespace OliverKlee\Seminars\OldModel; -use TYPO3\CMS\Core\Resource\FileReference; - /** * This class represents an event category. */ @@ -15,26 +13,4 @@ class LegacyCategory extends AbstractModel * @var string the name of the SQL table this class corresponds to */ protected static string $tableName = 'tx_seminars_categories'; - - /** - * @deprecated will be removed in version 6.0.0 in #3370 - */ - public function hasIcon(): bool - { - return $this->hasRecordPropertyInteger('icon'); - } - - /** - * @deprecated will be removed in version 6.0.0 in #3370 - */ - public function getIcon(): ?FileReference - { - if (!$this->hasIcon()) { - return null; - } - - $images = $this->getFileRepository()->findByRelation('tx_seminars_categories', 'icon', $this->getUid()); - - return \array_shift($images); - } } diff --git a/Classes/OldModel/LegacyEvent.php b/Classes/OldModel/LegacyEvent.php index 19dba0efb..e6cdce06c 100644 --- a/Classes/OldModel/LegacyEvent.php +++ b/Classes/OldModel/LegacyEvent.php @@ -3113,7 +3113,7 @@ public function getNumberOfCategories(): int * Gets this event's category titles and icons as an associative * array (which may be empty), using the category UIDs as keys. * - * @return array + * @return array */ public function getCategories(): array { @@ -3127,8 +3127,7 @@ public function getCategories(): array $result = []; foreach ($builder->build() as $category) { - // @deprecated icons will be removed in version 6.0.0 in #3370 - $result[$category->getUid()] = ['title' => $category->getTitle(), 'icon' => $category->getIcon()]; + $result[$category->getUid()] = ['title' => $category->getTitle()]; } return $result; diff --git a/Configuration/FlexForms/flexforms_pi1.xml b/Configuration/FlexForms/flexforms_pi1.xml index 1eb67a229..2b9a47e65 100644 --- a/Configuration/FlexForms/flexforms_pi1.xml +++ b/Configuration/FlexForms/flexforms_pi1.xml @@ -374,38 +374,6 @@ - - - 1 - - - - select - selectSingle - - - LLL:EXT:seminars/Resources/Private/Language/locallang.xlf:seminars.pi_flexform.fromTsSetup - - - - LLL:EXT:seminars/Resources/Private/Language/locallang.xlf:seminars.pi_flexform.iconAndText - both - - - LLL:EXT:seminars/Resources/Private/Language/locallang.xlf:seminars.pi_flexform.iconOnly - icon - - - LLL:EXT:seminars/Resources/Private/Language/locallang.xlf:seminars.pi_flexform.textOnly - text - - - 1 - 0 - 1 - - - 1 diff --git a/Configuration/TCA/tx_seminars_categories.php b/Configuration/TCA/tx_seminars_categories.php index fc0646f4f..7381decba 100644 --- a/Configuration/TCA/tx_seminars_categories.php +++ b/Configuration/TCA/tx_seminars_categories.php @@ -1,7 +1,5 @@ 'required,trim', ], ], - // @deprecated will be removed in version 6.0.0 in #3370 - 'icon' => [ - 'exclude' => 1, - 'label' => 'LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_categories.icon', - 'config' => ExtensionManagementUtility::getFileFieldTCAConfig( - 'icon', - [ - 'maxitems' => 1, - 'appearance' => [ - 'collapseAll' => true, - 'expandSingle' => true, - 'useSortable' => false, - 'enabledControls' => [ - 'sort' => false, - 'hide' => false, - ], - 'fileUploadAllowed' => true, - ], - ] - ), - ], 'single_view_page' => [ 'exclude' => 1, 'label' => 'LLL:EXT:seminars/Resources/Private/Language/locallang_db.xlf:tx_seminars_categories.single_view_page', @@ -60,6 +37,6 @@ ], ], 'types' => [ - '0' => ['showitem' => 'title, icon, single_view_page'], + '0' => ['showitem' => 'title, single_view_page'], ], ]; diff --git a/Configuration/TypoScript/FrontEnd.typoscript b/Configuration/TypoScript/FrontEnd.typoscript index 1edcf9387..ed30234d7 100644 --- a/Configuration/TypoScript/FrontEnd.typoscript +++ b/Configuration/TypoScript/FrontEnd.typoscript @@ -70,10 +70,6 @@ plugin.tx_seminars_pi1 { # the normal sorting) sortListViewByCategory = 0 - # how to display the categories in the event list view: icon, text, both - # @deprecated will be removed in version 6.0.0 in #3370 - categoriesInListView = both - # whether to use the label "Price" as column header for the standard price (instead of "Standard price") generalPriceInList = 0 diff --git a/Documentation/Reference/SetupForTheSeminarManagerFront-endPlug-inInPlugintxSeminarsPi1/Index.rst b/Documentation/Reference/SetupForTheSeminarManagerFront-endPlug-inInPlugintxSeminarsPi1/Index.rst index 5053370ea..f0f5a8eb8 100644 --- a/Documentation/Reference/SetupForTheSeminarManagerFront-endPlug-inInPlugintxSeminarsPi1/Index.rst +++ b/Documentation/Reference/SetupForTheSeminarManagerFront-endPlug-inInPlugintxSeminarsPi1/Index.rst @@ -354,22 +354,6 @@ override the corresponding value from TS Setup.** 0 -.. container:: table-row - - Property - categoriesInListView - - Data type - string - - Description - whether to show only the category title, only the category icon or - both. Allowed values are: icon, text, both - - Default - both - - .. container:: table-row Property diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 952ae2337..f1683d370 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -675,22 +675,6 @@ This event now has been confirmed. Which registration fields to show in the list of registrations for an event: - - - Display of the categories: - - - - Icons and text - - - - Icons only - - - - Text only - Link the single view from the list view: diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index b09dc5082..28a062d15 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -607,10 +607,6 @@ Title - - - Icon - Single view page for events in this category diff --git a/Resources/Private/Templates/FrontEnd/FrontEnd.html b/Resources/Private/Templates/FrontEnd/FrontEnd.html index 81974326c..9dfecd15f 100644 --- a/Resources/Private/Templates/FrontEnd/FrontEnd.html +++ b/Resources/Private/Templates/FrontEnd/FrontEnd.html @@ -245,7 +245,7 @@

###LABEL_CATEGORY###

    -
  • ###CATEGORY_TITLE### ###CATEGORY_ICON###
  • +
  • ###CATEGORY_TITLE###
diff --git a/Tests/Functional/OldModel/Fixtures/Categories.xml b/Tests/Functional/OldModel/Fixtures/Categories.xml index 9a4a795c4..68a83de4f 100644 --- a/Tests/Functional/OldModel/Fixtures/Categories.xml +++ b/Tests/Functional/OldModel/Fixtures/Categories.xml @@ -3,44 +3,5 @@ 1 Remote events - 0 - - 2 - Local events - 1 - - - 3 - Hybrid events - 1 - - - 1 - 1 - 3 - tx_seminars_categories - icon - - - - 4 - Remote events - 1 - - - - 1 - 1 - 0 - - c1a406ab82b5588738d1587da2761746ec584a6c - - /images/icon.png - - 43a8e2628978c99fde86fe9a946fb767e4313778 - icon.png - png - image/png - diff --git a/Tests/Functional/OldModel/LegacyCategoryTest.php b/Tests/Functional/OldModel/LegacyCategoryTest.php index d7f57b84c..99a255dc0 100644 --- a/Tests/Functional/OldModel/LegacyCategoryTest.php +++ b/Tests/Functional/OldModel/LegacyCategoryTest.php @@ -5,8 +5,6 @@ namespace OliverKlee\Seminars\Tests\Functional\OldModel; use OliverKlee\Seminars\OldModel\LegacyCategory; -use OliverKlee\Seminars\Tests\Functional\Traits\FalHelper; -use TYPO3\CMS\Core\Resource\FileReference; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; /** @@ -14,8 +12,6 @@ */ final class LegacyCategoryTest extends FunctionalTestCase { - use FalHelper; - protected array $testExtensionsToLoad = [ 'typo3conf/ext/static_info_tables', 'typo3conf/ext/feuserextrafields', @@ -34,53 +30,4 @@ public function fromUidMapsDataFromDatabase(): void self::assertSame('Remote events', $subject->getTitle()); } - - /** - * @test - */ - public function getIconWithoutIconReturnsNull(): void - { - $this->importDataSet(__DIR__ . '/Fixtures/Categories.xml'); - - $subject = new LegacyCategory(1); - - self::assertNull($subject->getIcon()); - } - - /** - * @test - */ - public function getIconWithNotYetMigratedIconReturnsNull(): void - { - $this->importDataSet(__DIR__ . '/Fixtures/Categories.xml'); - - $subject = new LegacyCategory(4); - - self::assertNull($subject->getIcon()); - } - - /** - * @test - */ - public function getIconWithPositiveIconCountWithoutFileReferenceReturnsNull(): void - { - $this->importDataSet(__DIR__ . '/Fixtures/Categories.xml'); - - $subject = new LegacyCategory(2); - - self::assertNull($subject->getIcon()); - } - - /** - * @test - */ - public function getIconWithFileReferenceReturnsFileReference(): void - { - $this->importDataSet(__DIR__ . '/Fixtures/Categories.xml'); - $this->provideAdminBackEndUserForFal(); - - $subject = new LegacyCategory(3); - - self::assertInstanceOf(FileReference::class, $subject->getIcon()); - } } diff --git a/Tests/LegacyFunctional/OldModel/LegacyEventTest.php b/Tests/LegacyFunctional/OldModel/LegacyEventTest.php index ae1c7f727..14394ea20 100644 --- a/Tests/LegacyFunctional/OldModel/LegacyEventTest.php +++ b/Tests/LegacyFunctional/OldModel/LegacyEventTest.php @@ -3181,7 +3181,7 @@ public function getCategoriesCanReturnOneCategory(): void $this->subject->getNumberOfCategories() ); self::assertSame( - [$categoryUid => ['title' => 'Test', 'icon' => null]], + [$categoryUid => ['title' => 'Test']], $this->subject->getCategories() ); } @@ -3232,8 +3232,8 @@ public function getCategoriesReturnsCategoriesOrderedBySorting(): void self::assertSame( [ - $categoryUid1 => ['title' => 'Test 1', 'icon' => null], - $categoryUid2 => ['title' => 'Test 2', 'icon' => null], + $categoryUid1 => ['title' => 'Test 1'], + $categoryUid2 => ['title' => 'Test 2'], ], $this->subject->getCategories() ); diff --git a/Tests/Unit/Model/CategoryTest.php b/Tests/Unit/Model/CategoryTest.php index b729e1ec4..a011fc3ee 100644 --- a/Tests/Unit/Model/CategoryTest.php +++ b/Tests/Unit/Model/CategoryTest.php @@ -38,73 +38,6 @@ public function getTitleWithNonEmptyTitleReturnsTitle(): void ); } - ////////////////////////////// - // Tests regarding the icon. - ////////////////////////////// - - /** - * @test - */ - public function getIconInitiallyReturnsAnEmptyString(): void - { - $this->subject->setData([]); - - self::assertSame( - '', - $this->subject->getIcon() - ); - } - - /** - * @test - */ - public function getIconWithNonEmptyIconReturnsIcon(): void - { - $this->subject->setData(['icon' => 'icon.gif']); - - self::assertSame( - 'icon.gif', - $this->subject->getIcon() - ); - } - - /** - * @test - */ - public function setIconSetsIcon(): void - { - $this->subject->setIcon('icon.gif'); - - self::assertSame( - 'icon.gif', - $this->subject->getIcon() - ); - } - - /** - * @test - */ - public function hasIconInitiallyReturnsFalse(): void - { - $this->subject->setData([]); - - self::assertFalse( - $this->subject->hasIcon() - ); - } - - /** - * @test - */ - public function hasIconWithIconReturnsTrue(): void - { - $this->subject->setIcon('icon.gif'); - - self::assertTrue( - $this->subject->hasIcon() - ); - } - ////////////////////////////////////////////// // Tests concerning the single view page UID ////////////////////////////////////////////// diff --git a/Tests/Unit/OldModel/LegacyCategoryTest.php b/Tests/Unit/OldModel/LegacyCategoryTest.php index d3852485d..8e94cd8a2 100644 --- a/Tests/Unit/OldModel/LegacyCategoryTest.php +++ b/Tests/Unit/OldModel/LegacyCategoryTest.php @@ -50,45 +50,4 @@ public function getTitleReturnsTitle(): void self::assertSame($title, $subject->getTitle()); } - - public function hasIconForNoDataReturnsFalse(): void - { - $subject = LegacyCategory::fromData([]); - - self::assertFalse($subject->hasIcon()); - } - - /** - * @return array - */ - public function noIconDataProvider(): array - { - return [ - 'empty string' => [''], - 'file name before migration' => ['icon.png'], - 'zero as string' => ['0'], - 'zero as integer' => [0], - ]; - } - - /** - * @test - * - * @param string|int $icon - * - * @dataProvider noIconDataProvider - */ - public function hasIconForNoIconReturnsFalse($icon): void - { - $subject = LegacyCategory::fromData(['icon' => $icon]); - - self::assertFalse($subject->hasIcon()); - } - - public function hasIconWithPositiveNumberOfIconsReturnsTrue(): void - { - $subject = LegacyCategory::fromData(['icon' => 1]); - - self::assertTrue($subject->hasIcon()); - } } diff --git a/ext_tables.sql b/ext_tables.sql index 3af4025f0..0f9b169b2 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -531,8 +531,6 @@ CREATE TABLE tx_seminars_target_groups ( # CREATE TABLE tx_seminars_categories ( title tinytext, - # @deprecated will be removed in version 6.0.0 in #3370 - icon int(11) unsigned DEFAULT '0' NOT NULL, single_view_page int(11) unsigned DEFAULT '0' NOT NULL, FULLTEXT index_searchfields (title) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0db77df35..3f7d7e957 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -295,11 +295,6 @@ parameters: count: 1 path: Classes/FrontEnd/AbstractView.php - - - message: "#^Cannot call method cObjGetSingle\\(\\) on TYPO3\\\\CMS\\\\Frontend\\\\ContentObject\\\\ContentObjectRenderer\\|null\\.$#" - count: 1 - path: Classes/FrontEnd/CategoryList.php - - message: "#^Cannot call method getTypoLink\\(\\) on TYPO3\\\\CMS\\\\Frontend\\\\ContentObject\\\\ContentObjectRenderer\\|null\\.$#" count: 1 @@ -362,7 +357,7 @@ parameters: - message: "#^Cannot call method cObjGetSingle\\(\\) on TYPO3\\\\CMS\\\\Frontend\\\\ContentObject\\\\ContentObjectRenderer\\|null\\.$#" - count: 3 + count: 2 path: Classes/FrontEnd/DefaultController.php - @@ -1200,11 +1195,6 @@ parameters: count: 1 path: Classes/OldModel/LegacyEvent.php - - - message: "#^Cannot call method getIcon\\(\\) on OliverKlee\\\\Seminars\\\\OldModel\\\\LegacyCategory\\|null\\.$#" - count: 1 - path: Classes/OldModel/LegacyEvent.php - - message: "#^Cannot call method getPublicUrl\\(\\) on TYPO3\\\\CMS\\\\Core\\\\Resource\\\\FileReference\\|null\\.$#" count: 1