[3.0] Import SMF\Time in Display, so a topic with a reply can be read - #9395
Merged
jdarwood007 merged 1 commit intoAug 8, 2026
Merged
Conversation
Display::loadMessages() measures the gap between consecutive posts to decide
whether to warn about replying to an old topic. It calls Time::create() without
importing SMF\Time, so inside namespace SMF\Actions the name resolves to
SMF\Actions\Time and there is nothing there:
Class "SMF\Actions\Time" not found - Sources/Actions/Display.php:335
The block runs whenever oldTopicDays is set, which it is by default at 120, for
every post in a topic other than the first. So viewing any topic that has been
replied to returns a 500.
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This was referenced Aug 8, 2026
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
Any topic that has been replied to returns a 500.
Display::loadMessages()measures the gap between consecutive posts to decidewhether to warn about replying to an old topic:
SMF\Timeis not imported, so insidenamespace SMF\Actionsthat name resolvesto
SMF\Actions\Time, which does not exist:The surrounding block is guarded by:
oldTopicDaysdefaults to 120, so the only thing standing between a forum andthis is having no post after the first one in any topic.
Testing
Clean install of
release-3.0(a7ac468b1), MySQL, default settings. Theshipped "Welcome to SMF!" topic reads fine with its single post. Add one reply to
it and:
?topic=1.0smf_log_errorsClass "SMF\Actions\Time" not foundatDisplay.php:335composer lintis clean.How it was found
By sweeping
Sources/for class names used unqualified inside a sub-namespacethat are neither imported nor declared there — the same shape as the
ThemeChooserbug in #9387. Two of the five candidates that survived filteringwere real; this is the more serious one. The other is a migration and is in a
separate PR.
If it would be useful I am happy to tidy the script up and propose it as a CI
step, since neither
phplintnorphp-cs-fixercatches this class of mistake andit fails only at runtime.
Issues References (Fixes|Related|Closes)
Related to #7933