ErrorException: Method 'fetchAll' will no longer be considered read-only in XF 2.3.8+

Chris59

New member
This was trigger by import a file to update my language, and also when i import a theme

xenforo 2.3.7

Server error log

  • ErrorException: Method 'fetchAll' will no longer be considered read-only in XF 2.3.8+
  • src/XF/Error.php:81
  • Generated by: Thaiadmin
  • Jul 22, 2025 at 10:16 PM

Stack trace​

#0 src/XF.php(266): XF\Error->logError('Method 'fetchAl...', false)
#1 src/XF/Util/Php.php(224): XF::logError('Method 'fetchAl...')
#2 src/XF/Template/Compiler/Syntax/Variable.php(104): XF\Util\Php::nameIndicatesReadOnly('fetchAll', 2)
#3 src/XF/Template/Compiler/Syntax/Variable.php(60): XF\Template\Compiler\Syntax\Variable->isFunctionCallAllowed('fetchAll', 2)
#4 src/XF/Template/Compiler/Syntax/Expression.php(22): XF\Template\Compiler\Syntax\Variable->compile(Object(XF\Template\Compiler), Array, true)
#5 src/XF/Template/Compiler/Tag/Set.php(21): XF\Template\Compiler\Syntax\Expression->compile(Object(XF\Template\Compiler), Array, true)
#6 src/XF/Template/Compiler/Syntax/Tag.php(47): XF\Template\Compiler\Tag\Set->compile(Object(XF\Template\Compiler\Syntax\Tag), Object(XF\Template\Compiler), Array, false)
#7 src/XF/Template/Compiler.php(276): XF\Template\Compiler\Syntax\Tag->compile(Object(XF\Template\Compiler), Array, false)
#8 src/XF/Template/Compiler/Tag/ForeachTag.php(15): XF\Template\Compiler->traverseBlockChildren(Array, Array)
#9 src/XF/Template/Compiler/Tag/ForeachTag.php(163): XF\Template\Compiler\Tag\ForeachTag->XF\Template\Compiler\Tag\{closure}('foreach', Array)
#10 src/XF/Template/Compiler/Tag/ForeachTag.php(18): XF\Template\Compiler\Tag\ForeachTag->compileToCallback(Object(XF\Template\Compiler\Syntax\Tag), Object(XF\Template\Compiler), Array, Object(Closure), false)
#11 src/XF/Template/Compiler/Syntax/Tag.php(47): XF\Template\Compiler\Tag\ForeachTag->compile(Object(XF\Template\Compiler\Syntax\Tag), Object(XF\Template\Compiler), Array, false)
#12 src/XF/Template/Compiler.php(276): XF\Template\Compiler\Syntax\Tag->compile(Object(XF\Template\Compiler), Array, false)
#13 src/XF/Template/Compiler.php(258): XF\Template\Compiler->traverseBlockChildren(Array, Array)
#14 src/XF/Service/Template/CompileService.php(35): XF\Template\Compiler->compileAst(Object(XF\Template\Compiler\Ast), Object(XF\Language))
#15 src/XF/Job/TemplateRebuild.php(92): XF\Service\Template\CompileService->recompile(Object(XF\Entity\Template))
#16 src/XF/Job/Atomic.php(40): XF\Job\TemplateRebuild->run(2.59941)
#17 src/XF/Job/Manager.php(275): XF\Job\Atomic->run(8)
#18 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#19 src/XF/Job/Manager.php(121): XF\Job\Manager->runJobEntry(Array, 8)
#20 src/XF/Admin/Controller/ToolsController.php(146): XF\Job\Manager->runByIds(Array, 8)
#21 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\ToolsController->actionRunJob(Object(XF\Mvc\ParameterBag))
#22 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\ToolsController), NULL)
#23 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\ToolsController), NULL)
#24 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#25 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#26 src/XF.php(806): XF\App->run()
#27 admin.php(15): XF::runApp('XF\\Admin\\App')
#28 {main}

Request state​

array(4) {
["url"] => string(24) "/admin.php?tools/run-job"
["referrer"] => string(47) "https://thaiforum.se/admin.php?languages/import"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(0) {
}
}
 
This isn't a bug. One of your templates will be doing direct database queries, which will no longer be supported beginning with the next version. You should use the template search to figure out which one.
 
thanks for point me to the right direction . researched it all and I had an add-on that I tried a while ago but that didn't work , it had just been deactivated so I uninstalled it and the problem solved . sorry i disturbed

Cheers Chris
 
This isn't a bug. One of your templates will be doing direct database queries, which will no longer be supported beginning with the next version. You should use the template search to figure out which one.
I have a similar error to the above when updating one of my custom addons.
Can you please share how to search for template to find those that makes direct database queries?
Thank you
 
You can search templates for the name of the method.
In my case, it was fetchOne method that caused the error but search couldn't find that method in any template. I'm on 2.3.7
  • ErrorException: Method 'fetchOne' will no longer be considered read-only in XF 2.3.8+
  • src/XF/Error.php:81
 
If you experience it when attempting updating the add-on, it's likely one of the templates belonging to the add-on. It's possible it doesn't exist in the installed version. You might want to search the _output/templates/ directory if you are the developer.
 
@Jeremy P Can somewhere in the call chain for a template recompile be updated to report the template which barfed an error? Template recompiles triggering errors are really a pain to debug for everyone involved.
 
If you experience it when attempting updating the add-on, it's likely one of the templates belonging to the add-on. It's possible it doesn't exist in the installed version. You might want to search the _output/templates/ directory if you are the developer.
This only happens in 2.3.7
I have the same addon in my testing site that run 2.3.6 and updating the addon does not generate this warning.
 
@Jeremy P Can somewhere in the call chain for a template recompile be updated to report the template which barfed an error? Template recompiles triggering errors are really a pain to debug for everyone involved.
This is already the case for most exceptions, this is a special case as the error is merely logged and compiled anyway. I would make this change for the next release if it weren't for the fact that it becomes a regular exception then already.

This only happens in 2.3.7
I have the same addon in my testing site that run 2.3.6 and updating the addon does not generate this warning.
The change was made in 2.3.7, so 2.3.6 will not log the same error.
 
  • Like
Reactions: Xon
Back
Top Bottom