• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

Affected version
2.0 DP10

Kirby

Well-known member
#1
\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
#5
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.
 

Mike

XenForo developer
Staff member
#6
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).