Fixed Similar thread cache rebuild failure: [E_DEPRECATED] preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated

TnT

Active member
Affected version
2.2.9
  • ErrorException: Similar thread cache rebuild failure: [E_DEPRECATED] preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated
  • src/XF/Str/Formatter.php:808

Stacktrace​

#0 [internal function]: XF::handlePhpError(8192, '[E_DEPRECATED] ...', '/var/www/xf/p...', 808)
#1 src/XF/Str/Formatter.php(808): preg_split('#(\\[\\w+(?:=[^\\]...', NULL, -1, 2)
#2 src/addons/XFES/Search/Source/Elasticsearch.php(303): XF\Str\Formatter->stripBbCode(NULL)
#3 src/addons/XFES/Search/Source/Elasticsearch.php(252): XFES\Search\Source\Elasticsearch->getMLTSearchQueryDsl(Object(XFES\Search\Query\MoreLikeThisQuery), Array, Array)
#4 src/addons/XFES/Search/Source/Elasticsearch.php(230): XFES\Search\Source\Elasticsearch->getMLTSearchDsl(Object(XFES\Search\Query\MoreLikeThisQuery), 100)
#5 src/addons/XFES/XF/Search/Search.php(36): XFES\Search\Source\Elasticsearch->moreLikeThis(Object(XFES\Search\Query\MoreLikeThisQuery), 100)
#6 src/XF/Search/Search.php(214): XFES\XF\Search\Search->XFES\XF\Search\{closure}(Object(XFES\Search\Query\MoreLikeThisQuery), 100)
#7 src/addons/XFES/XF/Search/Search.php(32): XF\Search\Search->executeSearch(Object(XFES\Search\Query\MoreLikeThisQuery), 100, Object(Closure), false)
#8 src/addons/XFES/XF/Repository/Thread.php(89): XFES\XF\Search\Search->moreLikeThis(Object(XFES\Search\Query\MoreLikeThisQuery), 100, false)
#9 src/addons/XFES/XF/Repository/Thread.php(54): XFES\XF\Repository\Thread->getSimilarThreadIds(Object(XFES\XF\Entity\Thread), 100, false)
#10 src/addons/XFES/Job/SimilarThreads.php(64): XFES\XF\Repository\Thread->rebuildSimilarThreadsCache(Object(XFES\XF\Entity\Thread))
#11 src/XF/Job/AbstractRebuildJob.php(47): XFES\Job\SimilarThreads->rebuildById(113575)
#12 src/addons/XFES/Job/SimilarThreads.php(23): XF\Job\AbstractRebuildJob->run(8)
#13 src/XF/Job/Manager.php(260): XFES\Job\SimilarThreads->run(8)
#14 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#15 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#16 src/XF/Cli/Command/RunJobs.php(59): XF\Job\Manager->runQueue(false, 8)
#17 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\RunJobs->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 src/vendor/symfony/console/Application.php(992): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\RunJobs), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 src/XF/Cli/Runner.php(111): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 cmd.php(15): XF\Cli\Runner->run()
#23 {main}

comes from

cmd.php xf:run-jobs



PHP version 8.1.5
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.12).

Change log:
Handle null arguments when stripping BBcode from strings
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom