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

Not a Bug Skip session report counts if reports are sent to forum (save a query)

Discussion in 'Resolved Bug Reports' started by AlexT, Oct 19, 2014.

  1. AlexT

    AlexT Well-Known Member

    You can save an unneeded query or two when reports are sent to a report forum rather than using the built-in report system. Specifically,

    XenForo_ControllerPublic_Abstract->_updateModeratorSessionReportCounts() should check if XenForo_Application::getOptions()->reportIntoForumId is set, and if it is, avoid calling rebuildReportCountCache() and/or getActiveReportsCountsForUser().

    Edit: Or alternatively one could do the necessary check within the Report model.
    Last edited: Oct 19, 2014
  2. AlexT

    AlexT Well-Known Member

    Nevermind, just discovered that the reportCounts cache wouldn't get updated anymore once you switch to the forum system, meaning it won't get stale and no further queries will be made.

Share This Page