[3.0] Imports the UserDataset enum that PM.php has been using without it - #9342
Merged
jdarwood007 merged 1 commit intoAug 2, 2026
Merged
Conversation
PM.php names UserDataset::Minimal and UserDataset::None in three places but never imports the enum, so PHP resolves it against the file's own namespace and looks for SMF\PersonalMessage\UserDataset. Sending a personal message therefore dies with "Class SMF\PersonalMessage\UserDataset not found" the moment PM::send() gets as far as loading the recipients. It happens on both databases and on every theme. 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
Sending a personal message fails outright on current
release-3.0:Sources/PersonalMessage/PM.phpusesUserDataset::MinimalandUserDataset::Noneat lines 1607, 1670 and 1917, but the file never imports the enum. Its own namespace isSMF\PersonalMessage, so an unqualified name resolves there rather than toSMF\UserDataset.PM::send()gets as far asUser::load($all_to, dataset: UserDataset::Minimal)when it goes to load the recipients, and dies. The message is not stored and the sender lands on an error page. Nothing in the class is guarded against it, so it happens every time, on both databases and on every theme.One line:
use SMF\UserDataset;.Testing
Docker environment, PostgreSQL 17. Before: composing a PM and pressing "Send message" produced the "Class not found" error page,
smf_personal_messagesunchanged, and ageneralrow inlog_errors. After: the PM is delivered, the sender is redirected to the inbox withdone=sent, the row is insmf_personal_messages, and the error log stays empty.vendor/bin/phpunit— 108 tests, 157 assertions, OK.Found while checking what the PostgreSQL error reporting in #9341 exposed. This one is not a query failure and is unrelated to that change; it just turned up on the way past.
The report in #9308 also mentions that the recipient autocomplete does not complete the way 2.1 does. That part does not reproduce here: on the same tree, typing into the To field returns an
auto_suggest_divpopulated fromaction=suggestas expected. Whatever is behind that half of the report is separate from this fix.Issues References (Fixes|Related|Closes)
Fixes #9308
Related to #9341