0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 16:23:34 +08:00
discourse/script/import_scripts
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
..
base
mbox DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
nodebb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
phpbb3 DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
quandora DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
settings
socialcast DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
support
answerbase.rb
answerhub.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
askbot.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
base.rb FIX: Scope duplicate topic title check to what the user can see (#41871) 2026-07-24 15:35:35 +02:00
bbpress.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
bespoke_1.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
csv_importer.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
csv_restore_staged_users.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
discuz_x.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
disqus.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
drupal-6.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
drupal.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
drupal_json.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
drupal_qa.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
elgg.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
flarum_import.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
fluxbb.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
friendsmegplus.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
fusionforge.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
getsatisfaction.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
google_groups.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
higher_logic.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
ipboard.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
ipboard3.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
jforum.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
jive.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
jive_api.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
json_generic.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
kunena.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
kunena3.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
lithium.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
mbox.rb
modx.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
muut.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
mybb.rb DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
mybbru.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
mylittleforum.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
nabble.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
ning.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
phorum.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
phpbb3.rb
punbb.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
question2answer.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
sfn.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
simplepress.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
slack.rb
smf1.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
smf2.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
sourceforge.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
stack_overflow.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
telligent.rb
vanilla.rb DEV: Enable some minor rubocop rules (#40094) 2026-05-19 15:29:38 +02:00
vanilla_body_parser.rb
vanilla_mysql.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
vbulletin.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
vbulletin3.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
vbulletin5.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
xenforo.rb DEV: Move AVATAR_DIR constant inside class scope (#38443) 2026-03-10 12:30:02 -07:00
yahoogroup.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00
yammer.rb DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
zendesk.rb
zendesk_api.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
zoho.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00