0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 05:42:36 +08:00
discourse/plugins/automation
Régis Hanol 3e012af58e
FIX: Scope duplicate topic title check to what the user can see (#41871)
Previously, the duplicate topic title check compared new titles against
every topic on the site regardless of visibility: users were blocked by
titles in categories they couldn't see or unlisted topics they couldn't
find, the bare "Title has already been used" error gave no way to locate
the conflict (and doubled as an existence oracle for hidden titles), and
the behavior was controlled by two entangled boolean settings.

This change scopes the check to the destination category plus whatever
the acting user can actually see, links the conflicting topic in the
error — safe by construction, since being blocked now implies being able
to see it:

> This title has already been used by [another topic]().

It also consolidates the two booleans into a single
`duplicate_topic_titles` enum (`disallowed` /
`allowed_across_categories` / `allowed`), with existing values migrated
and the old names kept as hidden deprecated aliases that admin search
still resolves.

Reported in
https://meta.discourse.org/t/title-has-already-been-used-in-a-secure-category/123047

Note for self-hosters: env-provided settings can't be migrated —
`DISCOURSE_ALLOW_DUPLICATE_TOPIC_TITLES=true` configs need to switch to
`DISCOURSE_DUPLICATE_TOPIC_TITLES=allowed`.
2026-07-24 15:35:35 +02:00
..
admin/assets/javascripts DEV: Remove ember-template-lint (#40077) 2026-05-15 20:54:13 +01:00
app DEV: Make automation recursion depth configurable (#40778) 2026-06-11 09:41:00 +10:00
assets UX: fix control position in automations table (#39899) 2026-05-12 10:40:28 -04:00
config I18N: Update translations (#41970) 2026-07-23 11:42:03 +02:00
db/migrate DEV: Tidy plugin API key scope resource names (#38640) 2026-03-17 13:03:42 +11:00
lib DEV: Add usage metrics for workflows, automations, and data explorer (#41437) 2026-07-13 11:41:58 +02:00
spec FIX: Scope duplicate topic title check to what the user can see (#41871) 2026-07-24 15:35:35 +02:00
test/javascripts/integration/components DEV: Update test module name conventions (#40389) 2026-05-29 15:19:55 +10:00
package.json DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00
plugin.rb DEV: Add usage metrics for workflows, automations, and data explorer (#41437) 2026-07-13 11:41:58 +02:00
tsconfig.json DEV: Add a script for generating external types in discourse-types (#37095) 2026-03-09 20:37:43 +01:00