[3.0] Import the classes the theme actions actually use - #9387
Open
albertlast wants to merge 1 commit into
Open
Conversation
SMF\Actions\ThemeChooser imports SMF\CacheApi and calls UserDataset without importing it at all; SMF\Actions\ThemeSetOption imports SMF\CacheApi as well. There is no SMF\CacheApi — the class is SMF\Cache\CacheApi — so both names resolve inside SMF\Actions and are not found. Choosing a theme for a member fatals with 'Class "SMF\Actions\UserDataset" not found' before it reaches the cache line, and saving a theme option would fail the same way on SMF\Actions\CacheApi. Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This was referenced Aug 8, 2026
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
SMF\Actions\ThemeChooserusesUserDatasetwithout importing it, so choosing atheme for a member fatals:
I hit this from the UI: Admin → Themes → Choose a theme, pick one, submit. The
member's theme is never saved and the page is replaced by the error. It is logged
in
smf_log_errorsagainst?action=themechooser.The same file, and
SMF\Actions\ThemeSetOption, also importSMF\CacheApi. Thereis no such class — it is
SMF\Cache\CacheApi;Sources/CacheApi.phpdoes notexist and nothing aliases the short name.
BackwardCompatibility::exportStatic()returns immediately when
$backward_compatibilityis empty, which it is bydefault in both
Settings.phpand the shippedother/Settings.php.ThemeChooserreaches itsCacheApi::put()only when a theme variant was chosen,and the bundled theme ships no variants, which is presumably why this has gone
unnoticed.
ThemeSetOptioncalls it on both of its paths.Testing
Before, on
release-3.0(a7ac468b1): submitting the theme picker gives theerror above and
smf_members.id_themeis unchanged.After: the same submission redirects to
?action=profile;area=theme;u=1, which isthe success path, and nothing new appears in
smf_log_errors.composer lintis clean on both files.Found while testing the theme picker for the #7933 split.
Issues References (Fixes|Related|Closes)
Related to #7933