Error Message when editing large number of topics

Does anyone know why I keep getting this error message when I try and edit more than about 60 topics at once.

‘‘Sorry, an error has occurred.’’

The only workaround is to edit a small number of topics at once - about 30.

It is a very expensive operation so it is timing out.

2 Likes

Thank you for the feedback, but is there a way to fix it?

Select less topics at once. I’d suggest keeping it to a about 50 per batch. If you need to bulk edit a very large number of topics, use of the rails console will be necessary. See Administrative Bulk Operations

3 Likes

I have thousands of topics in a category!

1 Like

Then using the rails console is the best solution here. See the link above for bulk operations.

1 Like

I can’t see an option to bulk delete all topics in a category?

The guide to delete all topics in a category is linked in the Destructive rake tasks section of the guide.

As noted in that guide, please be sure to take a backup before running any destructive tasks like these in case something doesn’t go well.

4 Likes

Right, I’m getting somewhere.

I have successfully bulk removed all topics in a category, but it’s not letting me delete the entire category now because it’s saying:

‘‘Can’t delete this category because topic count is 1.’’

As far as I can see, there are no topics.

Any ideas?

That’s odd. In that case, try deleting the category from the console. See Delete entire categories in the Bulk Operations topic for details.

1 Like

A quick follow up @christian_01. In the future, please ask for help with what your real issue is - in this case deleting a category with topics in it - rather than what you’re trying to do to solve the issue.

From what I gather, your ultimate goal is deleting a category with lots of topics in it. Had we know that from the beginning, I could’ve pointed you directly to the guide on deleting categories with topics. Instead, we ended up answering a number of other questions, which only got you part way to your goal. Please see

6 Likes

The destroy:topics task won’t delete topics that were created by the system user. It will also not delete pinned topics. This means there is a good chance that the category’s About topic will not be deleted. If that’s the case, you can delete it manually.

2 Likes

Yes, that’s the issue I’m having. The last topic to delete is the ‘About’, which I’m struggling to delete.

It’s possible that the About topic was unlisted. If you are logged into the site with a staff account, you should be able to see unlisted topics. If for some reason you can’t find the topic, you will be able to get it from the rails console.

No, it’s listed okay. I select delete, but it doesn’t go.

It does have replies. Does that matter?

Can you try deleting the topic with your browser’s web inspector open on its ‘console’ tab? There may be an error message that lets us know what the problem is.

The other place to look is in your site’s error logs (Admin / Logs / Error Logs.) Deselect the ‘Debug’, ‘Info’, and ‘Warning’ checkboxes from the bottom left of the error logs page so that you’ll only see the errors in the log list.

It should be possible to delete a topic that has replies.

Thank you for your feedback @simon.

I managed to delete the whole category successfully using ‘‘rake destroy:categories[…]’’

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.