Fixed [E_DEPRECATED] strtr(): Passing null to parameter #1

DevPunk

Member
Affected version
2.2
I have this message in the log over 50k times.
PHP 8.1
  • ErrorException: [E_DEPRECATED] strtr(): Passing null to parameter #1 ($string) of type string is deprecated
  • src/vendor/dokuwiki/utf8/utf8.php:430

Code:
#0 [internal function]: XF::handlePhpError(8192, '[E_DEPRECATED] ...', 's...', 430)
#1 src/vendor/dokuwiki/utf8/utf8.php(430): strtr(NULL, Array)
#2 src/XF/Repository/Tag.php(153): utf8_deaccent(NULL)
#3 src/XF/Entity/Tag.php(48): XF\Repository\Tag->generateTagUrlVersion(NULL)
#4 src/XF/Mvc/Entity/Entity.php(1366): XF\Entity\Tag->_preSave()
#5 src/XF/Import/DataHelper/Tag.php(42): XF\Mvc\Entity\Entity->preSave()
#6 src/XF/Import/DataHelper/Tag.php(9): XF\Import\DataHelper\Tag->createTag('efm', Array)
#7 src/addons/XFI/Import/Importer/vBulletin.php(3583): XF\Import\DataHelper\Tag->importTag('efm', 'thread', '2138954', Array)
#8 src/XF/Import/Runner.php(244): XFI\Import\Importer\vBulletin->stepContentTags(Object(XF\Import\StepState), Array, 8)
#9 src/XF/Import/ParallelRunner.php(213): XF\Import\Runner->runStep('contentTags', Object(XF\Import\StepState), 8)
#10 src/XF/Cli/Command/ImportChildProcess.php(77): XF\Import\ParallelRunner->runChildProcess('contentTags', 2136000, 2139000, Object(Closure))
#11 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\ImportChildProcess->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 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))
#13 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\ImportChildProcess), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 src/XF/Cli/Runner.php(111): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 cmd.php(15): XF\Cli\Runner->run()
#17 {main}


Code:
array(1) {
  ["cli"] => string(73) "/var/www/html/cmd.php xf:import-child-process contentTags 2136000 2139000"
}
 
I have now deactivated it and am testing it.
was curios...as that error is not a show-stopping error, but more of a notification. And you usually see those when you have developer mode enabled - which you should not keep normally enabled.
Since you are using PHP 8.1 (which is not a supported version) it may be something that the XF developers need to address if that's part of the package of XF.
 
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.14).

Change log:
Do not attempt to generate tag URLs without a valid tag
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom