[3.0] Import SMF\Maintenance\Maintenance in the DropTimeOffset migration - #9396
Open
albertlast wants to merge 1 commit into
Open
[3.0] Import SMF\Maintenance\Maintenance in the DropTimeOffset migration#9396albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
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>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Migration\v3_0\DropTimeOffsetcallswithout importing the class. Inside
namespace SMF\Maintenance\Migration\v3_0that resolves relative to the namespace:
Every sibling migration that touches
Maintenance::$toolimportsSMF\Maintenance\Maintenance—MigrationBase,v2_1\AgreementUpdate,v2_1\AlertsWatchedBoardsand the rest. This one is the exception.The call is in the branch that runs when the forum's stored
default_timezoneisempty or is not an identifier
timezone_identifiers_list()knows, so it isreached 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 thatare 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