0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 07:23:30 +08:00
discourse/script
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
..
benchmarks
bulk_import FIX: Preserve user locale data in generic bulk imports (#41957) 2026-07-23 01:13:49 -04:00
demon_test
import_scripts FIX: Scope duplicate topic title check to what the user can see (#41871) 2026-07-24 15:35:35 +02:00
.gitignore
alice.txt
analyse_message_bus.rb
analyze_sidekiq_queues.rb
assemble_ember_build.rb FIX: Build plugin JS assets when there is no prebuilt bundle (#41659) 2026-07-13 17:08:49 +02:00
backport.rb DEV: More improvements to backport automation (#40839) 2026-06-14 16:01:28 +01:00
bench.rb DEV: Remove Unicorn web server in favor of Pitchfork (#39032) 2026-04-01 15:04:59 +02:00
biggest_objects.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
boot_mem.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
cache_critical_dns DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
check_forking.rb
check_reproducible_assets.rb DEV: Prepare for rename of app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
copyright-deposit
create_upcoming_change_status_prs DEV: Automatic upcoming change status report and PR creation (#40291) 2026-06-11 15:19:15 +10:00
db_timestamps_mover.rb DEV: Ensure db_timestamps_mover only touches non-null columns (#40851) 2026-06-14 14:53:07 +01:00
diff_heaps.rb
discourse DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
docker_test.rb
generate_upcoming_change_status_report DEV: Fix UC status report when reverted files encountered (#41821) 2026-07-20 16:37:35 +10:00
i18n_lint.rb UX: Link to required settings from language switcher validation error (#38374) 2026-07-16 15:51:06 -04:00
install_minio_binaries.rb
list_bundled_plugins
local_minio_s3.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
memory-analysis DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
memstats.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
micro_bench.rb
mwrap_sidekiq DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
profile_db_generator.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
promote_migrations DEV: Promote old post-deploy migrations to pre-deploy (#38595) 2026-03-13 19:09:30 +00:00
publish_built_assets.rb DEV: Remove (again) the old non-rollup plugin compiler (#39419) 2026-04-21 21:07:46 +02:00
rails
redis_memory.rb
require_profiler.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
run-licensee DEV: Update licensee config & execution (#40454) 2026-06-03 15:48:08 +01:00
silence_successful_output
spawn_backup_restore.rb DEV: Rename Backuper to Creator 2026-01-22 18:46:02 +00:00
start_test_db.rb DEV: Improve db_structure tasks (#40067) 2026-05-15 11:40:07 +01:00
switch_container_ruby
test_email_settings.rb
test_mem.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
test_memory_leak.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
test_pretty_text.rb
thread_detective.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
upcoming_changes_status_report DEV: Automatic upcoming change status report and PR creation (#40291) 2026-06-11 15:19:15 +10:00
user_simulator.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00