diff --git a/CHANGELOG.md b/CHANGELOG.md index 266cdd530..e722860a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Removed ### Fixed + +## 1.4.1 + +### Fixed +- fix the sorting in the daily registration digest (#23) - require mkforms >= 3.0.14 (#22) ## 1.4.0 @@ -25,7 +30,6 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Changed - disable the legacy BE module in TYPO3 8LTS (#15) -- event status email should list upcoming events on top (#14) - require mkforms >= 3.0.0 (#6) - require static_info_tables >= 6.3.7 (#4) - move the extension to GitHub diff --git a/Classes/Mapper/Event.php b/Classes/Mapper/Event.php index a8edd7d6c..891f5a917 100644 --- a/Classes/Mapper/Event.php +++ b/Classes/Mapper/Event.php @@ -150,10 +150,9 @@ public function findNextUpcoming() */ public function findForAutomaticStatusChange() { - $whereClause = 'cancelled = ' . Tx_Seminars_Model_Event::STATUS_PLANNED . - ' AND automatic_confirmation_cancelation = 1'; + $whereClause = 'cancelled = ' . Tx_Seminars_Model_Event::STATUS_PLANNED . ' AND automatic_confirmation_cancelation = 1'; - return $this->findByWhereClause($whereClause, 'begin_date ASC'); + return $this->findByWhereClause($whereClause); } /** @@ -176,6 +175,6 @@ public function findForRegistrationDigestEmail() ' AND tx_seminars_attendances.crdate > tx_seminars_seminars.date_of_last_registration_digest' . ')'; - return $this->findByWhereClause($whereClause); + return $this->findByWhereClause($whereClause, 'begin_date ASC'); } } diff --git a/Documentation/Settings.yml b/Documentation/Settings.yml index 986405058..9d9ba0b36 100644 --- a/Documentation/Settings.yml +++ b/Documentation/Settings.yml @@ -7,7 +7,7 @@ conf.py: copyright: 2018 project: Seminar Manager version: 1.4 - release: 1.4.0 + release: 1.4.1 latex_documents: - - Index - seminars.tex diff --git a/Tests/Unit/Mapper/EventTest.php b/Tests/Unit/Mapper/EventTest.php index b2f06c784..20c135791 100644 --- a/Tests/Unit/Mapper/EventTest.php +++ b/Tests/Unit/Mapper/EventTest.php @@ -15,7 +15,6 @@ /** * Test case. * - * * @author Niels Pardon * @author Oliver Klee */ @@ -1077,33 +1076,6 @@ public function findForAutomaticStatusChangeNotFindsPlannedEventWithoutAutomatic self::assertTrue($result->isEmpty()); } - /** - * @test - */ - public function findForAutomaticStatusChangeSortsResultsByStartDateInAscendingOrder() - { - $laterUid = $this->testingFramework->createRecord( - 'tx_seminars_seminars', - [ - 'begin_date' => mktime(10, 0, 0, 1, 20, 2018), - 'cancelled' => Tx_Seminars_Model_Event::STATUS_PLANNED, - 'automatic_confirmation_cancelation' => 1 - ] - ); - $earlierUid = $this->testingFramework->createRecord( - 'tx_seminars_seminars', - [ - 'begin_date' => mktime(10, 0, 0, 1, 15, 2018), - 'cancelled' => Tx_Seminars_Model_Event::STATUS_PLANNED, - 'automatic_confirmation_cancelation' => 1 - ] - ); - - $result = $this->fixture->findForAutomaticStatusChange(); - - self::assertSame($earlierUid . ',' . $laterUid, $result->getUids()); - } - /* * Tests concerning findForRegistrationDigestEmail */ @@ -1162,6 +1134,44 @@ public function findForRegistrationDigestEmailFindsEventWithRegistrationAndWitho self::assertSame($eventUid, $result->first()->getUid()); } + /** + * @test + */ + public function findForRegistrationDigestEmailSortsEventsByBeginDateInAscendingOrder() + { + $laterEventUid = $this->testingFramework->createRecord( + 'tx_seminars_seminars', + [ + 'object_type' => Tx_Seminars_Model_Event::TYPE_COMPLETE, + 'begin_date' => mktime(10, 0, 0, 1, 20, 2018), + 'date_of_last_registration_digest' => 0, + 'registrations' => 1, + ] + ); + $this->testingFramework->createRecord( + 'tx_seminars_attendances', + ['seminar' => $laterEventUid, 'crdate' => 1] + ); + $earlierEventUid = $this->testingFramework->createRecord( + 'tx_seminars_seminars', + [ + 'object_type' => Tx_Seminars_Model_Event::TYPE_COMPLETE, + 'begin_date' => mktime(10, 0, 0, 1, 15, 2018), + 'date_of_last_registration_digest' => 0, + 'registrations' => 1, + ] + ); + $this->testingFramework->createRecord( + 'tx_seminars_attendances', + ['seminar' => $earlierEventUid, 'crdate' => 1] + ); + + $result = $this->fixture->findForRegistrationDigestEmail(); + + self::assertSame(2, $result->count()); + self::assertSame($earlierEventUid . ',' . $laterEventUid, $result->getUids()); + } + /** * @test */ diff --git a/ext_emconf.php b/ext_emconf.php index 1e4bfb58f..ab11ddb7a 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -31,7 +31,7 @@ 'author_company' => 'oliverklee.de', 'CGLcompliance' => '', 'CGLcompliance_note' => '', - 'version' => '1.4.0', + 'version' => '1.4.1', '_md5_values_when_last_written' => '', 'constraints' => [ 'depends' => [