From 3401c41f296a034ea9db8bacef77aca54e79e24f Mon Sep 17 00:00:00 2001 From: "John R. D'Orazio" Date: Mon, 25 Mar 2024 02:13:39 +0100 Subject: [PATCH] don't unset `Advent1` until while still comparing against it --- includes/FestivityCollection.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/FestivityCollection.php b/includes/FestivityCollection.php index eeb41fd4..dcbc8f66 100644 --- a/includes/FestivityCollection.php +++ b/includes/FestivityCollection.php @@ -592,7 +592,7 @@ public function purgeDataBeforeAdvent( int|null $buffer = null ) : void { public function purgeDataAdventChristmas( int|null $buffer = null ) { // the buffer should allow for foreach( $this->festivities as $key => $festivity ) { - if( $festivity->date >= $this->festivities[ "Advent1" ]->date ) { + if( $festivity->date > $this->festivities[ "Advent1" ]->date ) { unset( $this->festivities[ $key ] ); // make sure it isn't still contained in another collection unset( $this->solemnities[ $key ] ); @@ -602,6 +602,8 @@ public function purgeDataAdventChristmas( int|null $buffer = null ) { unset( $this->SolemnitiesLordBVM[ $key ] ); unset( $this->SundaysAdventLentEaster[ $key ] ); } + //lastly remove First Sunday of Advent + unset( $this->festivities[ "Advent1" ] ); /* Perhaps we shouldn't remove the Vigil Mass for the first Sunday of Advent? // also remove the Vigil Mass for the first Sunday of Advent if(