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

Fixed Load XFCP error in online page if an addon extends controller

sonnb

Well-known member
#1
If an addon extends a controller, session will probably write the extended class. When open online page, session will load the function
PHP:
public function addSessionActivityDetailsToList(array $activities)
    {
To load list of viewing page. In this function XF already made an catch function to catch this case:
PHP:
foreach ($controllerGroups AS $controller => $controllerGroup)
        {
            $controller = XenForo_Application::resolveDynamicClass($controller, 'controller');
            try
            {
                $canLoad = ($controller && XenForo_Application::autoload($controller));
            }
            catch (XenForo_Exception $e) {} // likely an XFCP autoload error - skip this
But function
PHP:
XenForo_Application::resolveDynamicClass($controller, 'controller');
already call XenForo_Application::autoload, so exception will be raised before this function can check for $canLoad.
 

Mike

XenForo developer
Staff member
#2
I've sorted the error here by moving both into the exception. However, this error isn't intrinsic to extending controllers. The error, IIRC, only happens if you use responseReroute with get_class/__CLASS_ in an XFCP class. In those cases, you should use the original class name and it should work correctly.
 

sonnb

Well-known member
#3
I've sorted the error here by moving both into the exception. However, this error isn't intrinsic to extending controllers. The error, IIRC, only happens if you use responseReroute with get_class/__CLASS_ in an XFCP class. In those cases, you should use the original class name and it should work correctly.
You are correct. I forgot that part.
 
Last edited: