MG 2.0 Method canViewMedia is not callable

ALMUSA

Well-known member
Im getting bunch of this error not sure what is happening
  • ErrorException: Template error: Method canViewMedia is not callable on the given object (XF\Entity\User)
  • src/XF/Template/Templater.php:932
  • Generated by: Unknown account
  • Mar 3, 2018 at 6:17 PM
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canViewM...', '/home/almusaf/p...', 932, Array)
#1 src/XF/Template/Templater.php(932): trigger_error('Method canViewM...', 512)
#2 internal_data/code_cache/navigation_cache.php(273): XF\Template\Templater->method(Object(XF\Entity\User), 'canViewMedia', Array)
#3 src/XF/Template/Templater.php(5657): XF\Pub\App->{closure}(Object(XF\Template\Templater), 'members', Array)
#4 src/XF/Pub/App.php(462): XF\Template\Templater->renderNavigationClosure(Object(Closure), 'members', Array)
#5 src/XF/Pub/App.php(415): XF\Pub\App->getNavigation(Array, 'members')
#6 src/XF/App.php(1724): XF\Pub\App->renderPageHtml('\n\n\n\n<div class=...', 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<div class=...', 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(1889): XF\Mvc\Dispatcher->run()
#10 src/XF.php(328): XF\App->run()
#11 index.php(13): XF::runApp('XF\\Pub\\App')
#12 {main}
 

Chris D

XenForo developer
Staff member
Are these happening repeatedly? They seem to be related to the Media navigation tab. Is the XFMG add-on disabled? Do you have any notices about outstanding manual jobs when you visit the Admin CP home page? Does the issue go away if you disable/enable or enable/disable the XFMG add-on?
 

DragonByte Tech

Well-known member
Are these happening repeatedly? They seem to be related to the Media navigation tab. Is the XFMG add-on disabled? Do you have any notices about outstanding manual jobs when you visit the Admin CP home page? Does the issue go away if you disable/enable or enable/disable the XFMG add-on?
It may not be related, but this bug report highlights a few ways this can happen: https://xenforo.com/community/threads/template-modifications-still-applied-during-add-on-uninstall.143074/


Fillip
 

ALMUSA

Well-known member
Are these happening repeatedly? They seem to be related to the Media navigation tab. Is the XFMG add-on disabled? Do you have any notices about outstanding manual jobs when you visit the Admin CP home page? Does the issue go away if you disable/enable or enable/disable the XFMG add-on?
Is the XFMG add-on disabled?
No

Do you have any notices about outstanding manual jobs when you visit the Admin CP home page?
No

Does the issue go away if you disable/enable or enable/disable the XFMG add-on?
I have not tried disabling the add-on. Just deleted the errors and I will be following up should they appear again.
 

Miguel Dias

Member
I also got similar errors

  • ErrorException: Template error: Method canViewMedia is not callable on the given object (XF\Entity\User)
  • src/XF/Template/Templater.php:934
Code:
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canViewM...', '/home/nginx/dom...', 934, Array)
#1 src/XF/Template/Templater.php(934): trigger_error('Method canViewM...', 512)
#2 internal_data/code_cache/navigation_cache.php(273): XF\Template\Templater->method(Object(XF\Entity\User), 'canViewMedia', Array)
#3 src/XF/Template/Templater.php(5724): XF\Pub\App->{closure}(Object(XF\Template\Templater), 'EWRporta', Array)
#4 src/XF/Pub/App.php(462): XF\Template\Templater->renderNavigationClosure(Object(Closure), 'EWRporta', Array)
#5 src/XF/Pub/App.php(415): XF\Pub\App->getNavigation(Array, 'EWRporta')
#6 src/XF/App.php(1726): XF\Pub\App->renderPageHtml('\n\t\n\n\n\t\n\t\n\t\n\n\n\n<...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#7 src/XF/Mvc/Dispatcher.php(310): XF\App->renderPage('\n\t\n\n\n\t\n\t\n\t\n\n\n\n<...', 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(1891): XF\Mvc\Dispatcher->run()
#10 src/XF.php(328): XF\App->run()
#11 index.php(13): XF::runApp('XF\\Pub\\App')
#12 {main}
After disable XFMG errors were gone.

Enabled XFMG again and no errors so far.
 

ALMUSA

Well-known member
The issue is that after the upgrade from xf 1 to xf2 XFMG file xfmg copied itself everywhere inside the root directory.
 
Top