For some groups where there are ‘message ghosts’ this doesn’t work. These groups can be identified by this query (provided that messaging has been restricted in the group interaction settings):
SELECT id, name, has_messages, messageable_level
From groups
Where messageable_level < 10
AND messageable_level <> 3
AND has_messages = true
ORDER by id
You can hack the groups table to force this to reset as well (in the Rails console of course, backup first!).
Group.where(id: XXX).update_all(has_messages: false)
If this doesn’t work or reverts, you might also need to clean up the topic_groups, topic_allowed_groups tables too:
TopicGroup.where(group_id: XXX).destroy_all
TopicAllowedGroup.where(group_id: XXX).destroy_all