Compatibility Problems

Discussion in '[bd] Widget Framework' started by nrep, Feb 25, 2014.

  1. nrep

    nrep New Member

    Hi,

    I'm having some problems getting Widget Framework to work with an existing addon I'm using (it's generating internal server errors for users a small percentage of the time).

    Here's the error log for one of the entries:

    Code:
    Error Info
    
    ErrorException: Fatal Error: Call to undefined method XenForo_Model_Thread::WidgetFramework_prepareThreadForRendererThreads() - library\WidgetFramework\WidgetRenderer\Threads.php:463
    Generated By: Unknown Account, 22 minutes ago
    
    Stack Trace
    
    #0 [internal function]: XenForo_Application::handleFatalError()
    #1 {main}
    
    Request State
    
    array(3) {
      ["url"] => string(28) "http://www.website.com/"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(0) {
      
    I've just looked up line 463 in that file and here's what it's showing, in case that helps:

    I'm wondering if it could be related to this part of the other plugin, which references 'XenForo_Model_Thread':

    PHP:
     private function _getPostModel()
    {
    $class XenForo_Application::resolveDynamicClass('XenForo_Model_Post');
    return new 
    $class;
    }
    private function 
    _getThreadModel()
    {
    $class XenForo_Application::resolveDynamicClass('XenForo_Model_Thread');
    return new 
    $class;
    }
    Is there a way I can troubleshoot this, as it's causing a huge problem for me on the forum?
     
  2. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    Hi there,

    Sorry to hear about your issue. The code snippet from the add-on looks a bit strange, normally developer shouldn't call resolveDynamicClass directly. And the exception message indicates problem with XenForo proxy class system. Please try changing the code snippet to these

    PHP:
    private function _getPostModel()
    {
    return 
    XenForo_Model::create('XenForo_Model_Post');
    }
    private function 
    _getThreadModel()
    {
    return 
    XenForo_Model::create('XenForo_Model_Thread');
    }
     
    nrep likes this.
  3. nrep

    nrep New Member

    Thank you xfrocks, I will test this now and give it a few hours to see if it has worked :).
     
  4. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    Good luck :)
     
  5. nrep

    nrep New Member

    So far so good, no errors as yet! :D
     
  6. xfrocks

    xfrocks XenForo rocks!
    Staff Member

  7. nrep

    nrep New Member

    Yes, this appears to have done the trick :D. Thank you!
     
    xfrocks likes this.
Loading...