1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Some kind of incompatibility with XFRocks' [bd] Banking

Discussion in 'Stock Trader Support' started by SneakyDave, Oct 24, 2014.

  1. SneakyDave

    SneakyDave Member Stock Trader Sportsbook

    Using version 1.3.0 of Stock Trader, and 0.9.9.1 of [bd] Banking, purchasing a stock results in this error message.
    Code:
    ErrorException: Declaration of bdBank_XenForo_DataWriter_Discussion_Thread::_discussionPostDelete() should be compatible with NFLJ_StockTrader_DataWriter_Discussion_Thread::_discussionPostDelete() -library/bdBank/XenForo/DataWriter/Discussion/Thread.php:0
    
    Actually, the error occurs anytime a new thread is created.

    It looks like [bd] Banking passes an array of $messages to the _discussionPostDelete() method, but Stockpicker doesn't, which leads to the incompatibility I guess.

    Is there a way to fix this?

    Complete trace:
    Code:
    ErrorException: Declaration of bdBank_XenForo_DataWriter_Discussion_Thread::_discussionPostDelete() should be compatible with NFLJ_StockTrader_DataWriter_Discussion_Thread::_discussionPostDelete() - library/bdBank/XenForo/DataWriter/Discussion/Thread.php:0
    Generated By: BJZ, 27 minutes ago
    Stack Trace
    #0 /blahlbahblalbahab/library/XenForo/Autoloader.php(119): XenForo_Application::handlePhpError(2048, 'Declaration of ...', '/home/nginx/dom...', 0, Array)
    #1 /blahlbahblalbahab/library/XenForo/Autoloader.php(119): XenForo_Autoloader::autoload()
    #2 /blahlbahblalbahab/library/XenForo/Application.php(1039): XenForo_Autoloader->autoload('bdBank_XenForo_...')
    #3 /blahlbahblalbahab/library/XenForo/Application.php(521): XenForo_Application::autoload('bdBank_XenForo_...')
    #4 /blahlbahblalbahab/library/XenForo/DataWriter.php(2038): XenForo_Application::resolveDynamicClass('XenForo_DataWri...', 'datawriter')
    #5 /blahlbahblalbahab/library/NFLJ/StockTrader/Model/Thread.php(86): XenForo_DataWriter::create('XenForo_DataWri...')
    #6 /blahlbahblalbahab/library/NFLJ/StockTrader/ControllerPublic/StockTrader.php(349): NFLJ_StockTrader_Model_Thread->createThread(Array)
    #7 /blahlbahblalbahab/library/XenForo/FrontController.php(347): NFLJ_StockTrader_ControllerPublic_StockTrader->actionBuyShares()
    #8 /blahlbahblalbahab/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #9 /blahlbahblalbahab/index.php(13): XenForo_FrontController->run()
    #10 {main}
    Request State
    array(3) {
    ["url"] => string(50) "https://blahblahblah/stocktrader/buy-shares"
    ["_GET"] => array(1) {
    ["/tester/stocktrader/buy-shares"] => string(0) ""
    }
    ["_POST"] => array(7) {
    ["shares"] => string(1) "1"
    ["_xftoken"] => string(53) "1,1414166341,779b1f5b3ff41ea0a2f0134ddf663d08f5168dae"
    ["symbol"] => string(4) "MPAC"
    ["_xfRequestUri"] => string(20) "/tester/stocktrader/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
    }
    }
    
     
    Last edited: Oct 24, 2014
  2. Bob

    Bob Developer Staff Member

    Im pretty sure this is an XF Version incompatibility issue (running a versions older than xf 1.2). Stock Trader requires xf 1.2 or above.

    This is the current method in the Core XenForo Datawriter ( XenForo_DataWriter_Discussion_Thread::_discussionPostDelete). As you can see, there is no $variable passed into that method.
    PHP:
        /**
         * Specific discussion post-delete behaviors.
         */
        
    protected function _discussionPostDelete()
        {
    Stock Trader
    PHP:
        protected function _discussionPostDelete()
        {
            
    $threadId $this->get('thread_id');
            
    $threadIdQuoted $this->_db->quote($threadId);
          
            
    $this->_db->delete('xf_nflj_stocktrader_stock_thread'"thread_id = $threadIdQuoted");
          
            return 
    parent::_discussionPostDelete();
        }
    IIRC (you'd have to look as I don't have access at this exact moment), I believe that prior to XF 1.2, the $messages variable was being passed in. I'd have to download a pre 1.2 version to check.

    REMOVED AS IT DOESN'T APPLY TO THIS
     
    Last edited: Oct 24, 2014
  3. Bob

    Bob Developer Staff Member

    btw, Stock Trader requires xf 1.2 or greater. If your version of XF is 1.2 or greater, then its the BD Bank addon that needs to do what I explained above. XF Rocks handles this same thing in the BD Widged Framework (exactly how I showed above)
     
  4. SneakyDave

    SneakyDave Member Stock Trader Sportsbook

    I'm using version 1.4.2 of XenForo though

    I assume the banking add-on needs to be changed to match it. I'll do some research.

    There is another error that add-on throws when deleting threads, so I assume it is that addon. Thanks, Bob
     
    Bob likes this.
  5. SneakyDave

    SneakyDave Member Stock Trader Sportsbook

    Yeah, version 1.1.4 of XenForo passes the array of $messages to that method, and 1.4.2 doesn't, so it appears to be an issue with BD Banking, I'll get with xfrocks to see if that can be fixed.
     
  6. Bob

    Bob Developer Staff Member

    The entire issue is with BD BANK. He needs to fix his addon to be forward compatible with xf 1.2 and above. Right now his addon is using pre xf 1.2 code.
     
    SneakyDave likes this.
  7. Bob

    Bob Developer Staff Member

    This is also the reason you are getting the error with Featured Threads.
     
    SneakyDave likes this.