Skip to content

[3.0] Import SMF\Maintenance\Maintenance in the DropTimeOffset migration - #9396

Open
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/migration-maintenance-import
Open

[3.0] Import SMF\Maintenance\Maintenance in the DropTimeOffset migration#9396
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/migration-maintenance-import

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Migration\v3_0\DropTimeOffset calls

Maintenance::$tool->updateModSettings(
	['default_timezone' => $forum_tzid],
	update: true,
);

without importing the class. Inside namespace SMF\Maintenance\Migration\v3_0
that resolves relative to the namespace:

SMF\Maintenance\Migration\v3_0\Maintenance     what the migration asks for   MISSING
SMF\Maintenance\Maintenance                    what it means                 exists

Every sibling migration that touches Maintenance::$tool imports
SMF\Maintenance\MaintenanceMigrationBase, v2_1\AgreementUpdate,
v2_1\AlertsWatchedBoards and the rest. This one is the exception.

The call is in the branch that runs when the forum's stored default_timezone is
empty or is not an identifier timezone_identifiers_list() knows, so it is
reached while upgrading exactly the forums that need the fallback written for
them.

Testing

I have not run a 2.1 → 3.0 upgrade to see it fail. What I have checked is the
resolution itself, above: the name the file currently asks for has no file behind
it, and the one it means does. That plus the sibling migrations all importing it
is what I am going on.

Happy to drive a real upgrade if you would rather have that before it goes in —
say the word.

How it was found

Sweeping Sources/ for class names used unqualified inside a sub-namespace that
are neither imported nor declared there. Two of the five surviving candidates were
real; the other is #9395, where the same mistake makes any topic with a reply
return a 500.

Issues References (Fixes|Related|Closes)

Related to #7933

The migration calls Maintenance::$tool->updateModSettings() without importing the
class, so inside namespace SMF\Maintenance\Migration\v3_0 the name resolves to
SMF\Maintenance\Migration\v3_0\Maintenance, which does not exist. Every sibling
migration that uses $tool imports SMF\Maintenance\Maintenance; this one does not.

The call sits in the branch that runs when the forum's stored default_timezone is
missing or is not an identifier PHP recognises, so it is reached while upgrading
exactly those forums that need the fallback.

Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@albertlast albertlast mentioned this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant