Permalinks break if a deleted topic's category is later deleted

From a cursory search, it looks like no-one else has been discussing this issue. Bug might be an unfair label because it also looks like I’m probably not using the permalink feature as it was intended. But nevertheless I thought I’d be a good open-source citizen and report this behavior.

Context: We used to have some documentation in our forum, which we decided to migrate to GitBook. To ensure that community members are pointed to the latest source of truth, I opted to delete the old wiki posts and use the permalinks feature to redirect to the appropriate place on our new docs site.

After setting up the permalinks, I deleted the topics, then deleted the categories. Note: I also set up redirects for the categories, which worked fine.

It seems that deleted topics whose categories are later deleted (and also redirected) exist somewhere in the database in a category-less state and that this breaks the topic’s redirect. If you’re not an admin, you get the standard “Oops! That page doesn’t exist” forum page, if you are an admin you can see the topic sans category. It’s also worth noting that all the deleted topics were all authored by admins, which probably influences the behavior.

The fix for this was to undelete each topic, move it into our Archive category, then delete again. Once I did this the redirects worked immediately.

1 Like