XF 2.0 ErrorException: Template error: Method canViewResources is not callable

TC44

Member
I'm having some issues that I'm trying to resolve after the latest Xenforo 2.0 update. I'm getting this in the error logs, along with another similar error, both pointing to Templater.php

If anyone can point me in the right direction to help resolve this, it would be much appreciated!

Thanks

---------------------------------------

ErrorException: Template error: Method canViewResources is not callable on the given object (XF\Entity\User) src/XF/Template/Templater.php:935

Stack trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canViewR...', '/home/myaccount/...', 935, Array)
#1 src/XF/Template/Templater.php(935): trigger_error('Method canViewR...', 512)
#2 internal_data/code_cache/navigation_cache.php(317): XF\Template\Templater->method(Object(XF\Entity\User), 'canViewResource...', Array)
#3 src/XF/Template/Templater.php(5746): XF\Pub\App->{closure}(Object(XF\Template\Templater), 'forums', Array)
#4 src/XF/Pub/App.php(462): XF\Template\Templater->renderNavigationClosure(Object(Closure), 'forums', Array)
#5 src/XF/Pub/App.php(415): XF\Pub\App->getNavigation(Array, 'forums')
#6 src/XF/App.php(1766): XF\Pub\App->renderPageHtml('\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#7 src/XF/Mvc/Dispatcher.php(310): XF\App->renderPage('\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#8 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#9 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#10 src/XF.php(328): XF\App->run()
#11 index.php(13): XF::runApp('XF\\Pub\\App')
#12 {main}

Request state

array(4) {
["url"] => string(1) "/"
["referrer"] => string(38) "https://mysite.com/whats-new/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
The first two errors on the attachment are the ones I'm referring to...

Thanks
 

Attachments

  • Screenshot 2018-06-27 at 7.35.24 PM.webp
    Screenshot 2018-06-27 at 7.35.24 PM.webp
    35 KB · Views: 30
Yes I have the same 2 errors also since upgrading to most recent xenforo2 version.

Screenshot 2018-10-18 at 8.39.29 PM.webp
How can I check if I have the most recent MG and RM addons? Is there a way I can easily check versions?

Thanks
 
You can see all of the latest versions here: https://xenforo.com/community/forums/announcements/

You should make sure you're running the latest versions of all of the relevant software.

If you're already doing that, it potentially sounds like the issues are sporadic. If so and you're not changing anything at the time, this could point to your opcode cache behaving incorrectly. Unfortunately, that's difficult for us to workaround, though we have seen weird opcode cache issues in the past (particularly with APC).
 
You should make sure you're running the latest versions of all of the relevant software.
Hi Mike, What's the easiest way to check this?
I know I'm running latest version of xenforo but not 100% sure about the MG or RM, can I check this in the backend?

Thanks
 
I ran into this issue today, lots of server errors like this:

ErrorException: Template error: Method canViewMedia is not callable on the given object (XF\Entity\User) src/XF/Template/Templater.php:994

Solved by increasing max_connection from the default 151 to 301.
 
Back
Top Bottom