Skip to content

[3.0] Stop seeding a recurrence rule into the recurrence dates - #9410

Merged
Sesquipedalian merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/holiday-seed-rdates
Aug 14, 2026
Merged

[3.0] Stop seeding a recurrence rule into the recurrence dates#9410
Sesquipedalian merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/holiday-seed-rdates

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Admin → Calendar → Holidays is an error page on every fresh install:

Failed to parse time string (FREQ=YEARLY) at position 0 (F):
The timezone could not be found in the database
                                        Sources/Calendar/Holiday.php:278

Two of the holidays the installer creates carry their own recurrence rule in the recurrence dates column. In Sources/Db/Schema/v3_0/Calendar.php:

'title'  => 'Cinco de Mayo',
'rrule'  => 'FREQ=YEARLY',
'rdates' => 'FREQ=YEARLY',     // ← should be ''

Same for Groundhog Day. Every other yearly holiday in that array has 'rdates' => '', and the 2.1 → 3.0 migration in HolidaysToEvents.php gets both of these right, so this is only the fresh-install seed.

rdates holds a list of dates. Holiday::list() takes the largest one and builds a \DateTimeImmutable out of it:

$max_rdate = max($row['rdates']);
$row['view_end'] = (new \DateTimeImmutable(substr($max_rdate, 0, strcspn($max_rdate, '/'))))->modify('+1 day');

so reading either row back throws, and the whole page goes with it.

The migration

3.0 is still Alpha, but a forum installed from an earlier alpha already has the two bad rows and would keep the broken page after upgrading. HolidayRecurrenceDates clears any rdates starting with FREQ= — a recurrence rule in that column can only have arrived this way, so the condition cannot catch a real date.

Checked

On the running forum, with the migration's UPDATE applied by hand: Admin → Calendar → Holidays renders and lists all 28 holidays, Cinco de Mayo and Groundhog Day among them, with nothing added to smf_log_errors.

That check needed #9405 in the tree as well — without it the same page dies a little later, in RecurrenceIterator, on the unrelated SMF\TimeInterval problem. The two fixes are independent; this one does not depend on that one to be correct, only to be observable.

Found by sweeping a stock forum's admin pages for fatals.

Issues References (Fixes|Related|Closes)

Related to #7933

Two of the holidays the installer creates, Cinco de Mayo and Groundhog Day,
were given 'rdates' => 'FREQ=YEARLY'. That is their rrule, and every other
yearly holiday in the same array has an empty rdates.

rdates holds a list of dates. Holiday::list() takes the largest one and
builds a \DateTimeImmutable out of it, so reading those two rows back throws
"Failed to parse time string (FREQ=YEARLY) at position 0 (F)", and
Admin -> Calendar -> Holidays is an error page on every fresh install.

The migration clears any rdates value that starts with FREQ=, since a
recurrence rule in that column can only have got there this way, so forums
already installed from the bad seed are repaired too.

Signed-off-by: Mathias Papenbrock <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@albertlast albertlast mentioned this pull request Aug 8, 2026
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 6 milestone Aug 8, 2026
@Sesquipedalian
Sesquipedalian merged commit 85ef8c2 into SimpleMachines:release-3.0 Aug 14, 2026
4 checks passed
@jdarwood007 jdarwood007 modified the milestones: 3.0 Alpha 6, 3.0 Alpha 5 Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants