XF 2.3 Error on some searches

mjda

Well-known member
So I'm getting this in the error log multiple times per day and was wondering if anyone else is getting this too? It just started happening after upgrading to 2.3. I am now running 2.3.2 and still having the issue.

I've noticed that it only does this on certain search queries, and has something to do with the auto-complete search. When the error triggers, there are no auto-complete search results shown.

Code:
ErrorException: [E_WARNING] Attempt to read property "message" on null src/XF/Search/Data/Thread.php:111
 
I'm seeing this too on 2.3.3 (PHP 8.3 & Elasticsearch 7.17).

Three errors logged at the same time but that's all it's ever happened so far:

Code:
ErrorException: [E_WARNING] Attempt to read property "message" on null src/XF/Search/Data/Thread.php:111
Generated by: MemberA Sep 4, 2024 at 1:35 PM

Stack trace
#0 src/XF/Search/Data/Thread.php(111): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/user/dom...', 111)
#1 src/XF/Search/Search.php(299): XF\Search\Data\Thread->getAutoCompleteResult(Object(SV\SearchImprovements\XF\Entity\ThreadCollab), Array)
#2 src/XF/ResultSet.php(129): XF\Search\Search->XF\Search\{closure}(Object(SV\SearchImprovements\XF\Entity\ThreadCollab), 'thread', 12708)
#3 src/XF/Search/Search.php(285): XF\ResultSet->getResultsDataCallback(Object(Closure))
#4 src/XF/Pub/Controller/SearchController.php(123): XF\Search\Search->getAutoCompleteResults(Object(XF\ResultSet), Array)
#5 src/XF/Mvc/Dispatcher.php(362): XF\Pub\Controller\SearchController->actionAutoComplete(Object(XF\Mvc\ParameterBag))
#6 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Search', 'AutoComplete', Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\SearchPatchFirst), NULL)
#7 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\SearchPatchFirst), NULL)
#8 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#10 src/XF.php(806): XF\App->run()
#11 index.php(23): XF::runApp('XF\\Pub\\App')
#12 {main}

Request state
array(4) {
  ["url"] => string(21) "/search/auto-complete"
  ["referrer"] => string(45) "https://domain.net/tags/******-******/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(6) {
    ["keywords"] => string(10) "*******"
    ["c"] => array(1) {
      ["users"] => string(0) ""
    }
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
    ["_xfWithData"] => string(1) "1"
    ["_xfRequestUri"] => string(21) "/tags/******-******/"
  }
}

I can trigger the error myself when typing the same keywords on the referrer page.

Tested with and without Search Improvements by @Xon disabled.
 
Did you convert your site from another platform? Go to thread 12708 on your site. I'd bet you get an error because the post(s) associated with the thread are non-existent. That's what's causing the error for me. I'm trying to figure out the best way to fix it.


That said, I didn't get this error until upgrading to 2.3, so something changed. Still, I'd like to get the threads with missing data removed.
 
Back
Top Bottom