Linked topics (splitting and managing megatopics)

I’ve just merged a feature which creates a new linked topic automatically when a topic is auto-closed based on auto close topics post count site setting.

This feature is especially useful for automatically splitting and managing megatopics.

Here’s how it works

Let’s say auto close topics post count setting is set to 10000 posts and a topic (with title “Introduce yourself!”) just reached that limit.

Now we’ll close that topic and create a new linked topic to continue the discussion. The first post of new topic will link to all prior discussions (topics).

The original topic title will be appended with “Part 1” and the new topic title with be appended with “Part 2”.

The subsequent topics will follow similar title naming convention.

There will also be a moderator post at the bottom of auto-closed topic indicating that there is a new topic available to continue discussion.

This feature is enabled by default. To disable the feature simply disable the site setting auto close topics create linked topic.

Note that this feature will be disabled if auto close topics post count is disabled (set to 0).

29 Likes

That’s awesome!

Is that something that could be used as solution to the “babble 10,000 messages issue”?

4 Likes

I have a small suggestion regarding these lines of code (and whatever else I missed):

previous_topics += "- [#{topic.title}](#{topic.url})\n"
parent_topic.add_moderator_post(system_user, I18n.t('create_linked_topic.moderator_post_raw', new_title: "[#{new_topic_title}](#{new_topic.url})"))

I’d recommend replacing [title](url) with just url, and relying on existing Discourse functionality that displays the title of the topic from the URL. If I’m not mistaken, this would have the bonus of auto-updating the topic title displayed if the topic is renamed, which I think would be a nice touch.

6 Likes

Yes, that’s a good idea @techAPJ we should probably do that.

Also, can we make it so there’s a single message rather than two? Why not have the “continue discussion” part be edited into the close message? Like:

This topic was automatically closed after reaching the maximum limit of 10000 replies. Continue this discussion at {link}

9 Likes

Done via:

Sure, done via:

11 Likes

This won’t work as well when you’re continuing the discussion from an access-restricted topic into another category without the exact same access restrictions.

1 Like

Is that a likely use case? It seems like generally the continuing topic would stay in the same category as the original topic. If this situation does happen, you say it won’t work as well, but what specifically would the behavior be?

4 Likes

Even without the linking issue, I’d expect the continuing topic to have inherited the exact same access restrictions. I’d see it as a bug if it didn’t.

4 Likes

Good point - it’s probably fine, then!

3 Likes

Hi, very nice feature, but two issues:

  1. How do we change the “Part” (1, 2 and so on) text? In English based forums is probably fine, but we would like to be able to change it.
  2. The category of the new topic. We’ve just got our first automatically linked topic and it was “uncategorized”. What we would like is the new topic to assume the category of the previously automatically closed topic.
4 Likes

Yes those are good points but the last time I checked the category was inherited properly, is that so @techAPJ?

3 Likes

You’ll need to update translation for these keys. See: Contribute a translation to Discourse

That is a valid bug. I’ll fix this on priority today.

I believe that might have been a manual update. I don’t see code for assigning category to linked topic.

6 Likes

Fixed via:

9 Likes

I’m also highly interested in this question.

1 Like