framework icon indicating copy to clipboard operation
framework copied to clipboard

[2.x] Flagged posts cannot be edited.

Open karl-bullock opened this issue 8 months ago • 5 comments

Current Behavior

When a post is flagged, it cannot be edited by anyone.

Steps to Reproduce

Post is flagged. Go to the post in question. Click the menu to edit the post. Entire menu is washed out, unable to click on any options, including "Edit."

Expected Behavior

The menu should come up as normal, not washed out and disabled options.

Screenshots

Image

Environment

I see this happening on Flarum Discuss, I didn't take the time to see if it's reproduced on other communities.

Output of php flarum info

No response

Possible Solution

No response

Additional Context

No response

karl-bullock avatar Mar 29 '26 14:03 karl-bullock

@linkrobins I just tried to replicate this, and although the menu is greyed out, I am still able to edit the post just fine..

Can you please confirm if this is the case?

imorland avatar Apr 11 '26 17:04 imorland

@linkrobins I just tried to replicate this, and although the menu is greyed out, I am still able to edit the post just fine..

Can you please confirm if this is the case?

I don't know what's changed, but after I mentioned it, everything seems to be working better? 🤔 But I wasn't the only one that mentioned it before. Unless it was a simple permission issue just on Discuss.

karl-bullock avatar Apr 11 '26 18:04 karl-bullock

I dug into this properly on a clean Flarum 2.0.0-rc.4 install (core + Flags only) and confirmed it's not reproducible in core, so I'll close it.

I flagged a post and inspected the post-controls menu as every relevant group, checking the computed style of each menu item:

Group Sees the flag frame? Controls menu on the flagged post
Guest no no controls menu
Member (flagPosts, not the author) no (no viewFlags) only Flag — enabled
Mod (viewFlags + editPosts) yes Flag / Edit / Delete — all enabled
Admin yes Flag / Edit / Delete — all enabled

In every case the Edit item is opacity: 1, pointer-events: auto, with no disabled class — nothing greyed.

Why it can't be the Flags extension: its only effect on a post is the Post--flagged class (a 2px border) and an override of Post.prototype.header() to draw the "Flagged by…" frame. The controls dropdown lives in .Post-actions, separate from header(), and there's no Flags CSS touching .Post-controls and nothing setting disabled/loading on those buttons.

The one case where Edit is genuinely unavailable is a flagged post that is also hidden — core's moderationControls only adds Edit when !isHidden, so you see Restore instead. That's by design (restore, then edit), not a greyed-out menu.

This lines up with @imorland's "greyed but still works" — whatever I saw on Discuss was environmental (a third-party extension or custom CSS overriding the dropdown), not core or Flags. Closing as not reproducible in core.

karl-bullock avatar Jun 22 '26 22:06 karl-bullock

Reopening this. I have a reliable reproduction now, which I think also explains why it looked intermittent back in March.

The posts involved were awaiting approval, not only flagged. flarum/flags adds no opacity of its own, so the washed out menu comes from .Post--unapproved. With the fade sitting on the whole post element it takes the controls menu with it, and the menu ends up behind whatever follows it in the stream, which is what swallows the clicks. It only shows up when there is another post after it, so it is easy to miss.

To reproduce, with Approval enabled:

  1. Post a reply, then set is_approved = 0 on its row in the posts table
  2. Make sure there is another post after it in the stream
  3. Open the controls menu on the unapproved post

Same family as several older reports:

  • flarum/issue-archive#328 (2016, still open)
  • flarum/issue-archive#274
  • #950 and #3031, both closed as duplicates of #328
  • #4212

The direction I am looking at is the one askvortsov1 suggested on #328, scoping the fade to the text rather than the whole post:

.Post--unapproved {
  .Post-body, .Post-footer {
    opacity: 0.5;
  }
}

Verifying it on both 1.x and 2.x before I propose anything.

karl-bullock avatar Jul 24 '26 22:07 karl-bullock

https://github.com/user-attachments/assets/b118e26c-15bf-462f-98ff-98edcb03e2db

Uploaded a video, should be easier to see from there The post is flagged and requires approval

huoxin233 avatar Jul 26 '26 10:07 huoxin233