0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/app/views
Régis Hanol beba9d0c11
FIX: Hide posts while media added by an edit awaits review
When an edit adds media that `skip_review_media_groups` requires staff to
approve, queueing a reviewable is not enough. At creation the check holds the
whole post back until it is approved, but on the edit path the media stayed
publicly visible until a moderator got to the queue, defeating the point of a
review meant to happen before publication.

The post is now hidden — and the topic unlisted when it is the first post —
under a dedicated hidden reason while the review is pending. Approving through
the existing approve-and-unhide action restores both. The author is told what
happened in a PM, and every placeholder (app, crawler view, RSS) explains the
post is awaiting media review instead of claiming it was flagged by the
community.

Reusing the hidden flag means the flag system could unhide the post while the
media review was still pending: a moderator disagreeing with an unrelated
flag, a user withdrawing one, or the author editing a flag-hidden post would
all have published the unreviewed media. Unhiding now refuses while a media
review is pending unless it is forced, which only the review's approval and a
staff member explicitly unhiding the post do.

Since this hide is not a flag:

- the flag cooldown no longer locks the author out of editing — editing a
  media-hidden post never unhides it, so there is nothing to game;
- hiding no longer overwrites the visibility reason of a topic that was
  already unlisted, so approving the media cannot silently relist a topic a
  moderator deliberately unlisted (which also fixes the same long-standing
  clobber on the flag path);
- the system message options only include a flag reason when there is an
  actual flag, since interpolating `flag_reasons.` with no type stuffed the
  entire translation subtree into the job arguments.

Hiding is only worth doing if the content is actually hidden, so the topic's
og:image and the RSS channel description — which rendered the first post's
raw — no longer advertise the content of a hidden first post.

System-driven revisions (`skip_validations`) are exempt from the check,
matching creation where programmatic post creation never goes through the
new-post checks; refreshing a topic embed should not unlist a blog topic.
2026-08-04 17:11:08 +02:00
..
about FEATURE: Localizable /about page fields via its settings page (#41123) 2026-06-26 20:41:08 +08:00
admin/backups
application FIX: Respect forced color mode for logo on server-rendered pages (#37032) 2026-01-09 11:33:06 +01:00
badges
categories
common DEV: Drop empty core mobile/desktop stylesheets (#41988) 2026-07-23 20:30:13 +01:00
default DEV: Replace JS build system with Rolldown (#35963) 2026-05-29 11:11:55 +01:00
dev_mode DEV: Add /dev-mode endpoint for MiniProfiler auth cookie (#37027) 2026-01-12 10:01:20 +08:00
email UX: add preview to email templates (#36657) 2026-01-08 11:33:53 +04:00
embed DEV: Extract embed post date title into i18n-aware helper (#38594) 2026-03-17 09:12:21 -05:00
exceptions DEV: Replace JS build system with Rolldown (#35963) 2026-05-29 11:11:55 +01:00
finish_installation DEV: escape emails in finish installation (#37665) 2026-02-10 11:53:18 +01:00
groups
home_page DEV: Show login-required splash in root route (take 2) (#32629) 2025-05-14 11:25:43 -04:00
invites
layouts FIX: Prevent browsers from restoring stale documents in bfcache mode (#42207) 2026-07-31 17:24:47 +02:00
list FIX: Prevent double-escaping of HTML entities in titles and meta descriptions (#41261) 2026-07-02 20:26:35 +02:00
metadata
offline
posts
published_pages DEV: properly import color-scheme-stylesheets (#36325) 2025-11-28 13:57:22 -06:00
qunit DEV: Drop empty core mobile/desktop stylesheets (#41988) 2026-07-23 20:30:13 +01:00
robots_txt
safe_mode
search
session
sitemap
static FIX: improve the reliability of chat sounds (#41373) 2026-07-02 18:52:41 -04:00
tags
topics FIX: Hide posts while media added by an edit awaits review 2026-08-04 17:11:08 +02:00
user_notifications DEV: Strip unsubscribe links when sending digest previews to arbitrary addresses (#38298) 2026-03-05 13:58:51 -06:00
users FIX: Preserve URI delimiters in ICS URL properties, removing TEXT escaping (#42107) 2026-07-28 14:53:16 -05:00