1. Tan Tran

    Tan Tran - Jan 13, 2016 New Member

    Credit
    Point
    Hello,

    I have tested the latest version of Credits Premium on PHP 7.0.1 and it did not work (working fine with PHP 5.6.16). I was getting these errors:
    PHP:
    ErrorExceptionFatal Error'continue' not in the 'loop' or 'switch' context library/Brivium/Credits/Action.php:238
    Line 238:
    PHP:
      public function setActionHandler($actionId)
       {
         if(isset(
    $this->_actionHandlers[$actionId])){
           return 
    $this->_actionHandlers[$actionId];
         }
         
    $this->_actionHandlers[$actionId] = false;
         
    $disableActions = array();
         if (!
    $this->_dependencies instanceof XenForo_Dependencies_Admin)
         {
           
    $disableActions $this->_disabledActions;
         }
         if(!
    $disableActions){
           
    $disableActions = array();
         }
         if(!empty(
    $this->_actionClasses[$actionId])){
           
    $handlerClass $this->_actionClasses[$actionId];
           if (
    strpos($handlerClass'_') === false)
           {
             
    $handlerClass 'Brivium_Credits_ActionHandler_' $handlerClass '_ActionHandler';
           }

           if(empty(
    $this->_actionHandlers[$actionId]) && !in_array($actionId$disableActions)){
             try
             {
               if (!
    $handlerClass || !class_exists($handlerClass))
               {
                          continue;
               }

               
    $handlerClass XenForo_Application::resolveDynamicClass($handlerClass);
               
    $handler = new $handlerClass();
               if(
    $handler && $handler->canUseAction()){
                 
    $this->_actionHandlers[$actionId] = $handler;
               }
             }
             catch (
    Exception $e) {}
           }
         }
         return 
    $this->_actionHandlers[$actionId];
       }
    The addon is great but please add support for PHP 7. Thank you
     
    Loading...
  2. Brivium

    Brivium - Jan 14, 2016 XenForo Services Staff Member

    Credit
    Point
    Hello,

    Thanks for your reported bug(s). We will have an upgrade version to solve your issue(s) shortly.

    Regards,
     
    #2
  3. Tan Tran

    Tan Tran - Jan 16, 2016 New Member

    Credit
    Point
    Hello,
    Thanks for version 2.0.6. It fixed the error i posted above. There is one more error that is showing up when i try to visit /credits. Please take a look.

    Here is the error log:
    PHP:
    Error Info
    ErrorException
    : Array to string conversion library/Brivium/Credits/ActionHandler/Abstract.php:327
    Generated By
    Admin7 minutes ago
    Stack Trace

    #0 /var/www/vhosts/example.com/httpdocs/library/Brivium/Credits/ActionHandler/Abstract.php(327): XenForo_Application::handlePhpError(8, 'Array to string...', '/var/www/vhosts...', 327, Array)
    #1 /var/www/vhosts/example.com/httpdocs/library/Brivium/Credits/Action.php(442): Brivium_Credits_ActionHandler_Abstract->canTriggerEvent(Array, Array, 0)
    #2 /var/www/vhosts/example.com/httpdocs/library/Brivium/Credits/Action.php(421): Brivium_Credits_Action->checkTriggerActionEvent(Array, Array, 0)
    #3 /var/www/vhosts/example.com/httpdocs/library/Brivium/Credits/Action.php(411): Brivium_Credits_Action->checkTriggerActionEvents(Array, Array, 0)
    #4 /var/www/vhosts/example.com/httpdocs/library/Brivium/Credits/ControllerHelper/Credit.php(83): Brivium_Credits_Action->canTriggerActionEvents('transfer')
    #5 /var/www/vhosts/example.com/httpdocs/library/Brivium/Credits/ControllerPublic/Credits.php(1163): Brivium_Credits_ControllerHelper_Credit->getWrapper('credits', 'index', Object(XenForo_ControllerResponse_View))
    #6 /var/www/vhosts/example.com/httpdocs/library/Brivium/Credits/ControllerPublic/Credits.php(135): Brivium_Credits_ControllerPublic_Credits->_getWrapper('credits', 'index', Object(XenForo_ControllerResponse_View))
    #7 /var/www/vhosts/example.com/httpdocs/library/XenForo/FrontController.php(351): Brivium_Credits_ControllerPublic_Credits->actionIndex()
    #8 /var/www/vhosts/example.com/httpdocs/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #9 /var/www/vhosts/example.com/httpdocs/index.php(13): XenForo_FrontController->run()
    #10 {main}

    Request State

    array(3) {
      [
    "url"] => string(34"https://www.example.com/credits/"
      
    ["_GET"] => array(0) {
      }
      [
    "_POST"] => array(0) {
      }
    }
    Update: I also notice that most actions can not be fired, credit transactions are not recorded on PHP 7.

    Best Regards,
     
    Last edited: Jan 16, 2016
    #3