Skip to content

[3.0] Couldn't attach into new topics - #9868

Open
jdarwood007 wants to merge 1 commit into
SimpleMachines:release-3.0from
jdarwood007:3.0/attachErrors
Open

jdarwood007 wants to merge 1 commit into
SimpleMachines:release-3.0from
jdarwood007:3.0/attachErrors

Conversation

@jdarwood007

Copy link
Copy Markdown
Member

Additionally resolves not getting a error back

@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Nov 11, 2026
@albertlast

Copy link
Copy Markdown
Collaborator

Letting a new post (no message yet) skip canModifyMsg() looks right. Editing an existing post still fails on 3.0, though, and it is in the same check.

canModifyMsg() calls a bare allowedTo() inside namespace SMF\Actions. The global allowedTo() lives in Subs-Compat.php and only exists when $backward_compatibility is on, and off is the default. On a forum with it off, I called canModifyMsg() with this PR applied, as the admin, for an existing message:

backward_compatibility=0 user=1 msg=1 board=1
THROW Error: Call to undefined function SMF\Actions\allowedTo()

So uploading an attachment while editing a post still fatals. User::$me->allowedTo('modify_any', $id_board) and User::$me->allowedTo('modify_own', $id_board) would avoid that.

The $this->msg === 0 test at the top of canModifyMsg() reads the property rather than the $id_msg parameter, but those are the same value at the only call site.

Additionally resolves not getting a error back
@jdarwood007

Copy link
Copy Markdown
Member Author

Its what happens when you write for one and copy the code between them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants