diff --git a/Classes/Service/DestinationDataImportService/Slugger/Date.php b/Classes/Service/DestinationDataImportService/Slugger/Date.php index 5114bae..dc210ba 100644 --- a/Classes/Service/DestinationDataImportService/Slugger/Date.php +++ b/Classes/Service/DestinationDataImportService/Slugger/Date.php @@ -40,8 +40,11 @@ class Date implements SluggerType public function prepareRecordForSlugGeneration(array $record): array { + $start = new \DateTimeImmutable('@' . $record['start']); + $record['event-title'] = $this->getEventTitle((int) $record['event']); - $record['start'] = (new \DateTimeImmutable('@' . $record['start']))->format('Y-m-d'); + $record['start'] = $start->format('Y-m-d'); + $record['start-with-time'] = $start->format('Y-m-d\TH-i-s'); return $record; } diff --git a/Configuration/TCA/tx_events_domain_model_date.php b/Configuration/TCA/tx_events_domain_model_date.php index c69b9ec..c891509 100644 --- a/Configuration/TCA/tx_events_domain_model_date.php +++ b/Configuration/TCA/tx_events_domain_model_date.php @@ -206,7 +206,7 @@ return [ 'type' => 'slug', 'size' => 50, 'generatorOptions' => [ - 'fields' => ['event-title', 'start', 'uid'], + 'fields' => ['event-title', 'start-with-time'], 'fieldSeparator' => '-', 'prefixParentPageSlug' => false, ], diff --git a/Documentation/Changelog/3.3.0.rst b/Documentation/Changelog/3.3.0.rst index 08cce13..457ab5d 100644 --- a/Documentation/Changelog/3.3.0.rst +++ b/Documentation/Changelog/3.3.0.rst @@ -20,7 +20,13 @@ Features Fixes ----- -Nothing +* Fix changing slugs for dates on re import. + The UID was part of the slug. + Each import will delete all dates and re create them. + That would lead to new slugs due to new uid. + The default now was changed to use the event title (as before) and start (as + before) with time (new). + That should hopefully be unique enough. Tasks ----- diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv index 5ac991e..116b36c 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportsExampleAsExpected.csv @@ -16,19 +16,19 @@ Bitte beachten Sie die derzeit geltenden Zugangsregeln.",,"http://www.stadtbibli Es gilt die 2G-PLUS-Regel.",,,,,,,"1","2",,"8","3",,"1",,3,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen" "tx_events_domain_model_date",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,"uid","pid","cruser_id","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","event","start","end","canceled","postponed_date","canceled_link","slug",,,,,,,,,,,,,,,,,, -,"1","2","0","0","0","0",-1,0,"0","0","0","1","1671458400","1671463800","no","0",,"allerlei-weihnachtliches-heute-mit-johannes-geisser-2022-12-19-1",,,,,,,,,,,,,,,,,, -,"2","2","0","0","0","0",-1,0,"0","0","0","2","1671199200","1671204600","no","0",,"tueftlerzeit-2022-12-16-2",,,,,,,,,,,,,,,,,, -,"3","2","0","0","0","0",-1,0,"0","0","0","2",1648803600,1648810800,"no","0",,"tueftlerzeit-2022-04-01-3",,,,,,,,,,,,,,,,,, -,"4","2","0","0","0","0",-1,0,"0","0","0","2",1648890000,1648897200,"no","0",,"tueftlerzeit-2022-04-02-4",,,,,,,,,,,,,,,,,, -,"5","2","0","0","0","0",-1,0,"0","0","0","2","1645106400","1645113600","no","0",,"tueftlerzeit-2022-02-17-5",,,,,,,,,,,,,,,,,, -,"6","2","0","0","0","0",-1,0,"0","0","0","3","1669917600","1669921200","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-12-01-6",,,,,,,,,,,,,,,,,, -,"7","2","0","0","0","0",-1,0,"0","0","0","3","1667642400","1667649600","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-05-7",,,,,,,,,,,,,,,,,, -,"8","2","0","0","0","0",-1,0,"0","0","0","3","1668247200","1668254400","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-12-8",,,,,,,,,,,,,,,,,, -,"9","2","0","0","0","0",-1,0,"0","0","0","3","1668852000","1668859200","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-19-9",,,,,,,,,,,,,,,,,, -,"10","2","0","0","0","0",-1,0,"0","0","0","3","1667728800","1667736000","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-06-10",,,,,,,,,,,,,,,,,, -,"11","2","0","0","0","0",-1,0,"0","0","0","3","1668333600","1668340800","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-13-11",,,,,,,,,,,,,,,,,, -,"12","2","0","0","0","0",-1,0,"0","0","0","3","1668938400","1668945600","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-20-12",,,,,,,,,,,,,,,,,, -,"13","2","0","0","0","0",-1,0,"0","0","0","3","1671732000","1671735600","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-12-22-13",,,,,,,,,,,,,,,,,, +,"1","2","0","0","0","0",-1,0,"0","0","0","1","1671458400","1671463800","no","0",,"allerlei-weihnachtliches-heute-mit-johannes-geisser-2022-12-19t14-00-00",,,,,,,,,,,,,,,,,, +,"2","2","0","0","0","0",-1,0,"0","0","0","2","1671199200","1671204600","no","0",,"tueftlerzeit-2022-12-16t14-00-00",,,,,,,,,,,,,,,,,, +,"3","2","0","0","0","0",-1,0,"0","0","0","2",1648803600,1648810800,"no","0",,"tueftlerzeit-2022-04-01t09-00-00",,,,,,,,,,,,,,,,,, +,"4","2","0","0","0","0",-1,0,"0","0","0","2",1648890000,1648897200,"no","0",,"tueftlerzeit-2022-04-02t09-00-00",,,,,,,,,,,,,,,,,, +,"5","2","0","0","0","0",-1,0,"0","0","0","2","1645106400","1645113600","no","0",,"tueftlerzeit-2022-02-17t14-00-00",,,,,,,,,,,,,,,,,, +,"6","2","0","0","0","0",-1,0,"0","0","0","3","1669917600","1669921200","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-12-01t18-00-00",,,,,,,,,,,,,,,,,, +,"7","2","0","0","0","0",-1,0,"0","0","0","3","1667642400","1667649600","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-05t10-00-00",,,,,,,,,,,,,,,,,, +,"8","2","0","0","0","0",-1,0,"0","0","0","3","1668247200","1668254400","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-12t10-00-00",,,,,,,,,,,,,,,,,, +,"9","2","0","0","0","0",-1,0,"0","0","0","3","1668852000","1668859200","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-19t10-00-00",,,,,,,,,,,,,,,,,, +,"10","2","0","0","0","0",-1,0,"0","0","0","3","1667728800","1667736000","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-06t10-00-00",,,,,,,,,,,,,,,,,, +,"11","2","0","0","0","0",-1,0,"0","0","0","3","1668333600","1668340800","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-13t10-00-00",,,,,,,,,,,,,,,,,, +,"12","2","0","0","0","0",-1,0,"0","0","0","3","1668938400","1668945600","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-11-20t10-00-00",,,,,,,,,,,,,,,,,, +,"13","2","0","0","0","0",-1,0,"0","0","0","3","1671732000","1671735600","no","0",,"adventliche-orgelmusik-orgel-kmd-frank-bettenhausen-2022-12-22t18-00-00",,,,,,,,,,,,,,,,,, "tx_events_domain_model_location",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,"uid","pid","cruser_id","hidden","starttime","endtime","sys_language_uid","l10n_parent","t3ver_oid","t3ver_wsid","t3ver_state","name","street","district","city","zip","country","latitude","longitude","phone",,,,,,,,,,,,,,,, ,"1","2","0","0","0","0",-1,0,"0","0","0","Schillerhaus Rudolstadt","Schillerstraße 25",,"Rudolstadt","07407","Deutschland","50.720971023259","11.335229873657","+ 49 3672 / 486470",,,,,,,,,,,,,,,,