We have a number of old groups at our site which don’t have any messages in their inbox or archive, but they’re still visible in the sidebar and at /my/messages.
That definitely sounds like a bug. If set to nobody the group mailbox imho should not be visible.
I imagine a workaround fix could be to use the Theme component to add groups as classes and then use each group class to display none on group mailboxes that are set to nobody. I say to use group classes as I imagine if you use CSS to hide them in general it might also hide the moderators group mail box.
Did those old groups previously have messages in them? I have a group on my personal site that just had one message in it and the inbox appears in the sidebar. I just deleted the message and the group inbox is still showing.
The deleted message no longer shows up in the inboxes, even to me as admin. I was able to browse back to it in my browser history and see it still exists as a deleted message. I tried removing the group and it did not let me. I undeleted it and removed the group. Then deleted the message for good measure.
The inbox is still showing - so I suspect there is still some other deleted message in that group inbox.
So yes, there is some bug here, methinks - if the only messages in a group inbox are deleted then the group inbox should not appear in the sidebar.
The only fix at the moment methinks is to delete the group and recreate it.
It would be interesting to use data explorer to get the post id of any deleted messages in a group inbox to confirm my theory, and get a look at those posts.
I ran the database consistency job, but the inboxes are still there. I’m an admin user on the site if that makes any difference. But they should disappear as they are empty – latest, new, unread, archive all have no messages.
-- [params]
-- group_id :inboxgroup
SELECT tg.topic_id, t.id AS topic_exists, t.deleted_at
FROM topic_allowed_groups tg
LEFT JOIN topics t ON t.id = tg.topic_id
WHERE tg.group_id = :inboxgroup
AND (
t.deleted_at IS NULL
OR t.id IS NULL
)
It should only display topics if the inbox is shown.
I have already found a way for this to happen even though the inbox is empty:
After a message which was sent to that group is turned into a public topic.
So:
Create a new group
Allow at least admins to message the group
Add a member to the group to check whether the inbox is shown
Send a message to the group
Use the “make public topic” option in the admin wrench menu
The inbox is empty but even after the database consistency job ran the inbox does not disappear
And in this case the data explorer query above returns that topic