• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to 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.

Fixed Error is server logs

Status
Not open for further replies.

C.Birch

Member
AMS Premium
SC Premium
UBS Premium
Hi,

I have just checked my sites Server Error Logs from within Xenforo Admin CP and i have spotted its full of the following error.

Code:
ErrorException: Argument 1 passed to NFLJ_Showcase_ControllerPublic_Comment::getCommentSpecificRedirect() must be an array, boolean given, called in /var/www/vhosts/****/public_html/library/NFLJ/Showcase/ControllerPublic/Comment.php on line 24 and defined - library/NFLJ/Showcase/ControllerPublic/Comment.php:28
Generated By: Unknown Account, Today at 1:32 PM
Code:
#0 /var/www/vhosts/****/public_html/library/NFLJ/Showcase/ControllerPublic/Comment.php(28): XenForo_Application::handlePhpError(4096, 'Argument 1 pass...', '/var/www/vhosts...', 28, Array)
#1 /var/www/vhosts/****/public_html/library/NFLJ/Showcase/ControllerPublic/Comment.php(24): NFLJ_Showcase_ControllerPublic_Comment->getCommentSpecificRedirect(false, false, 5)
#2 /var/www/vhosts/****/public_html/library/XenForo/FrontController.php(310): NFLJ_Showcase_ControllerPublic_Comment->actionIndex()
#3 /var/www/vhosts/****/public_html/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#4 /var/www/vhosts/****/public_html/index.php(13): XenForo_FrontController->run()
#5 {main}
Code:
array(3) {
  ["url"] => string(47) "http://www.yourpshome.net/showcase-comment/183/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Trying to access a comment that doesn't exist. Most likely a deleted comment that has been indexed is my guess, or someone messing around changing the ID in the URL string for fun.

I've added in a redirect to the showcase landing page when the provided ID returns a false.
 
I would say, it's google bots and that going by the rate its being listed in the logs :)
 
until the next release, you can swap out the old method with this new one (to stop the error log from filling up)

File to edit: /library/NFLJ/Showcase/ControllerPublic/Comment.php

Method to replace: public function actionIndex (replace entire method with the one below)

PHP:
    public function actionIndex()
    {
        $commentId = $this->_input->filterSingle('comment_id', XenForo_Input::UINT);
 
        $scItemModel = $this->_getSCItemModel();
        $scCommentModel = $this->_getSCCommentModel();
 
        if (!$comment = $scCommentModel->getCommentById($commentId))
        {
            return $this->responseRedirect(
                XenForo_ControllerResponse_Redirect::SUCCESS,
                XenForo_Link::buildPublicLink('showcase')
            );               
        }
       
        $item = $scItemModel->getItemById($comment['item_id']);
       
        return $this->getCommentSpecificRedirect($comment, $item, XenForo_ControllerResponse_Redirect::RESOURCE_CANONICAL_PERMANENT);
    }
 
Status
Not open for further replies.
Back
Top