From 1be49065f2b87a7db7a2996ecdad9a11865c3e16 Mon Sep 17 00:00:00 2001 From: Daniel Lovegrove Date: Thu, 6 Aug 2026 09:34:05 -0500 Subject: [PATCH 1/6] Add failing test case --- test/phpunit/csvImportValidator/CsvEventDateTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/phpunit/csvImportValidator/CsvEventDateTest.php b/test/phpunit/csvImportValidator/CsvEventDateTest.php index 5ba7d88ea1..ac48b2dba7 100644 --- a/test/phpunit/csvImportValidator/CsvEventDateTest.php +++ b/test/phpunit/csvImportValidator/CsvEventDateTest.php @@ -30,6 +30,7 @@ public function setUp(): void '"","","","another title","","","1995","Creation","19950101","","","en"', '"","","","yet another title","","","1997|1998","Creation|Accumulation","1997-01-01 | 1998-01-01","","","en"', '"","","","fifth title","","","1997","Creation","19970204 ","","","en"', + '"","","","zero month and day","","","2000 - 2001","Creation","2000-00-00","2001-00-00","","en"', ]; // Test for invalid values in one or both fields From ca0b34e29e4b486092467e4d17b0f7322e2c6440 Mon Sep 17 00:00:00 2001 From: Daniel Lovegrove Date: Thu, 6 Aug 2026 09:35:32 -0500 Subject: [PATCH 2/6] Treat YYYY-00-00 as valid --- lib/task/import/validate/csvEventDateValidator.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/task/import/validate/csvEventDateValidator.class.php b/lib/task/import/validate/csvEventDateValidator.class.php index e3d28759cf..602c2f95a9 100644 --- a/lib/task/import/validate/csvEventDateValidator.class.php +++ b/lib/task/import/validate/csvEventDateValidator.class.php @@ -114,6 +114,11 @@ protected function checkDate(?string $eventDate) return true; } + // Check for YYYY-00-00 format for dates + if (preg_match('/^[0-9]{4}-00-00(\s*)$/', $date)) { + return true; + } + // Check for YYYY-MM format for dates if (preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])(\s*)$/', $date)) { return true; From 9ceaa27974041e1286e7278458de9ef1bc843497 Mon Sep 17 00:00:00 2001 From: Daniel Lovegrove Date: Thu, 6 Aug 2026 10:59:46 -0500 Subject: [PATCH 3/6] Add YYYY-00 test and validation --- lib/task/import/validate/csvEventDateValidator.class.php | 4 ++-- test/phpunit/csvImportValidator/CsvEventDateTest.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/task/import/validate/csvEventDateValidator.class.php b/lib/task/import/validate/csvEventDateValidator.class.php index 602c2f95a9..c576a5dc27 100644 --- a/lib/task/import/validate/csvEventDateValidator.class.php +++ b/lib/task/import/validate/csvEventDateValidator.class.php @@ -114,8 +114,8 @@ protected function checkDate(?string $eventDate) return true; } - // Check for YYYY-00-00 format for dates - if (preg_match('/^[0-9]{4}-00-00(\s*)$/', $date)) { + // Check for YYYY-00-00/YYYY-00 format for dates + if (preg_match('/^[0-9]{4}-00(-00)?(\s*)$/', $date)) { return true; } diff --git a/test/phpunit/csvImportValidator/CsvEventDateTest.php b/test/phpunit/csvImportValidator/CsvEventDateTest.php index ac48b2dba7..bda15bc37a 100644 --- a/test/phpunit/csvImportValidator/CsvEventDateTest.php +++ b/test/phpunit/csvImportValidator/CsvEventDateTest.php @@ -31,6 +31,7 @@ public function setUp(): void '"","","","yet another title","","","1997|1998","Creation|Accumulation","1997-01-01 | 1998-01-01","","","en"', '"","","","fifth title","","","1997","Creation","19970204 ","","","en"', '"","","","zero month and day","","","2000 - 2001","Creation","2000-00-00","2001-00-00","","en"', + '"","","","zero month no day","","","1979","Creation","1979-00","1979-00","","en"', ]; // Test for invalid values in one or both fields From a052f20b9c63c830341d48f5725097ce2a2bc112 Mon Sep 17 00:00:00 2001 From: Daniel Lovegrove Date: Thu, 6 Aug 2026 11:25:51 -0500 Subject: [PATCH 4/6] Run post-install on cypress explicitly --- .github/workflows/integration-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 042c85a526..469e636ffd 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -48,6 +48,8 @@ jobs: key: npm-${{ hashFiles('package-lock.json') }} - name: Install NPM dependencies run: sudo npm install -g npm && npm ci + - name: Install Cypress binary + run: npx cypress install - name: Modify Gearman config run: | echo -e "all:\n servers:\n default: 127.0.0.1:4730" \ From 7d9ba21f386f29bf745b9475c2ca7c447f8b891d Mon Sep 17 00:00:00 2001 From: Daniel Lovegrove Date: Thu, 6 Aug 2026 11:41:17 -0500 Subject: [PATCH 5/6] Revert "Run post-install on cypress explicitly" This reverts commit 5c58d5749402d480a64accb9090c0d5b07c3d7a7. --- .github/workflows/integration-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 469e636ffd..042c85a526 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -48,8 +48,6 @@ jobs: key: npm-${{ hashFiles('package-lock.json') }} - name: Install NPM dependencies run: sudo npm install -g npm && npm ci - - name: Install Cypress binary - run: npx cypress install - name: Modify Gearman config run: | echo -e "all:\n servers:\n default: 127.0.0.1:4730" \ From 82b7f18b7ec956bc4fd73fd899ef288b85d802b6 Mon Sep 17 00:00:00 2001 From: Daniel Lovegrove Date: Mon, 17 Aug 2026 11:59:05 -0500 Subject: [PATCH 6/6] Add YYYY-MM-00 as a valid date format --- lib/task/import/validate/csvEventDateValidator.class.php | 4 ++-- test/phpunit/csvImportValidator/CsvEventDateTest.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/task/import/validate/csvEventDateValidator.class.php b/lib/task/import/validate/csvEventDateValidator.class.php index c576a5dc27..aac30a736e 100644 --- a/lib/task/import/validate/csvEventDateValidator.class.php +++ b/lib/task/import/validate/csvEventDateValidator.class.php @@ -119,8 +119,8 @@ protected function checkDate(?string $eventDate) return true; } - // Check for YYYY-MM format for dates - if (preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])(\s*)$/', $date)) { + // Check for YYYY-MM/YYYY-MM-00 format for dates + if (preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])(-00)?(\s*)$/', $date)) { return true; } diff --git a/test/phpunit/csvImportValidator/CsvEventDateTest.php b/test/phpunit/csvImportValidator/CsvEventDateTest.php index bda15bc37a..1d2702545f 100644 --- a/test/phpunit/csvImportValidator/CsvEventDateTest.php +++ b/test/phpunit/csvImportValidator/CsvEventDateTest.php @@ -30,8 +30,9 @@ public function setUp(): void '"","","","another title","","","1995","Creation","19950101","","","en"', '"","","","yet another title","","","1997|1998","Creation|Accumulation","1997-01-01 | 1998-01-01","","","en"', '"","","","fifth title","","","1997","Creation","19970204 ","","","en"', - '"","","","zero month and day","","","2000 - 2001","Creation","2000-00-00","2001-00-00","","en"', - '"","","","zero month no day","","","1979","Creation","1979-00","1979-00","","en"', + '"","","","YYYY-00-00 Date format","","","2000 - 2001","Creation","2000-00-00","2001-00-00","","en"', + '"","","","YYYY-00 Date format","","","1979","Creation","1979-00","1979-00","","en"', + '"","","","YYYY-MM-00 Date format","","","June-July 1993","Creation","1993-06-00","1993-07-00","","en"', ]; // Test for invalid values in one or both fields