Having issues extending thread/add-reply

Jaxel

Well-known member
So I am extending the add-reply as follows:

Code:
    public function actionAddReply()
    {
        $response = parent::actionAddReply();
       
        if ($this->_noRedirect())
        {
            $threadId = $this->_input->filterSingle('thread_id', XenForo_Input::UINT);
            $article = $this->getModelFromCache('EWRporta2_Model_Articles')->getArticleByThreadIdOrAuto($threadId);
           
            if(!empty($article['article_options']['comments']))
            {
                return $this->responseView(
                    'XenForo_ViewPublic_Thread_ViewNewPosts',
                    'EWRporta2_Thread_NewPosts',
                    $response->params
                );
            }
        }
       
        return $response;
    }

This code works great for QUICK reply. However, if a user instead clicks the "More Options" button, then click "Reply to Thread" option, it will return the following error:

Undefined property: XenForo_ControllerResponse_Redirect::$params
  1. XenForo_Application::handlePhpError() in EWRporta2/ControllerPublic/Thread.php at line 47
  2. EWRporta2_ControllerPublic_Thread->actionAddReply() in XenForo/FrontController.php at line 347
  3. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  4. XenForo_FrontController->run() in /index.php at line 13
Why is this error happening? The message still posts.
 
Wait, no, I think I got it. The parent isn't return a responseView in this case; its returning a response redirect.
 
Top Bottom