Toggling staff color on a post doesn't get applied when done as TL4 user

AI-generated summary

A bug was reported where TL4 users could add staff colors to posts, but the changes wouldn’t persist after reloading the topic. anon42064797 shared screenshots illustrating the issue. PJH confirmed that the issue only affects TL4 users. codinghorror and sam suggested that TL4 users shouldn’t have the ability to set staff colors.

A fix was implemented by techAPJ to resolve the text not changing for the button when adding staff color, which affected all users. A follow-up fix was also implemented to prevent TL4 users from seeing the “Add Staff Color” button, resolving the issue.

I opened the wrench menu, clicked “Add Staff Color” and opened it again shortly after that:


As you can see, the post turns yellow, but the button still says “Add Staff Color”.
When I reload the topic, the yellow color disappears:

Same thing applies when trying to “Remove Staff Color” from posts.

Moderators don’t suffer from this issue, apparently.

8개의 좋아요

Seems like a legit bug, can you take it monday @techAPJ?

1개의 좋아요

Experimentation indicates that it’s only TL4’s with this issue. Mod-only, Admin-only and Mod+Admin don’t.

I don’t know that TL4 should even have this function, it is called “staff color” for a reason.

3개의 좋아요

I agree, I think the bug here is that we are allowing non-staff to set staff colors.

2개의 좋아요

Sent a fix for “text not changing for button when adding staff color” issue (this was affecting all users: TL4, Mod-only, Admin-only and Mod+Admin).

https://github.com/discourse/discourse/pull/3156?1

Edit: “Not allow TL4 user to set staff color” issue is a WIP. Done!

2개의 좋아요

Okay, now TL4 user will not be able to see the “Add Staff Color” button :bug:

https://github.com/discourse/discourse/pull/3158

4개의 좋아요