Not a bug Return value of \XF\Entity\Forum::canViewModeratedThreads() is not always bool

Affected version
2.0 DP10


Well-known member
\XF\Entity\Forum::canViewModeratedThreads() does return bool or the curren visitor user_id.
This is inconsistent with all other canXXX methods on entities which just return a bool.

Chris D

XenForo developer
Staff member
Well, it's technically correct as it's a different use case. There may or may not be alternative approaches we can take, but a minor consistency point may not override the technical reasons for the current approach.


XenForo developer
Staff member
FWIW, we have now changed this for beta 7. This functionality can still happen via the finder (or within canView).

There's a much more significant change here as well that only opts into this behavior if the user has recently submitted content that needed to be approved. This has changed the signature of a lot of methods. However, for bigger forums, it should provide a good performance benefit as it means better index usage in many cases (such as when a registered user views a forum).