Calendar Fixed Events Near Me Errors out

Affected version
2.4

nik

Member

Hitting Events Near me produces the below in ACP. I suspect possibly as you're triggering search and I'm using Threadloom as default search (though XF search is also enabled).​


  • ErrorException: Template error: [E_USER_WARNING] Method canViewCalendars is not callable on the given object (Andrew\ModeratorPanel\XF\Entity\User)
  • src/XF/Template/Templater.php:1161
  • Generated by: Unknown account
  • Apr 20, 2021 at 7:14 PM

Stack trace​

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/nginx/dom...', 1161, Array)
#1 src/XF/Template/Templater.php(1161): trigger_error('Method canViewC...', 512)
#2 internal_data/code_cache/navigation_cache.php(941): XF\Template\Templater->method(Object(Andrew\ModeratorPanel\XF\Entity\User), 'canViewCalendar...', Array)
#3 src/XF/Template/Templater.php(7378): XF\Pub\App->{closure}(Object(MaZ\AMP\XF\Template\XF22\Templater), NULL, Array)
#4 src/XF/Pub/App.php(575): XF\Template\Templater->renderNavigationClosure(Object(Closure), NULL, Array)
#5 src/XF/Pub/App.php(526): XF\Pub\App->getNavigation(Array, NULL)
#6 src/XF/App.php(2131): XF\Pub\App->renderPageHtml('










...', Array, Object(XF\Mvc\Reply\View), Object(ThemeHouse\StyleSwitch\XF\Mvc\Renderer\Html))
#7 src/XF/Mvc/Dispatcher.php(402): XF\App->renderPage('










...', Object(XF\Mvc\Reply\View), Object(ThemeHouse\StyleSwitch\XF\Mvc\Renderer\Html))
#8 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#9 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#10 src/XF.php(488): XF\App->run()
#11 index.php(20): XF::runApp('XF\\Pub\\App')
#12 {main}

Request state​

array(4) {
["url"] => string(38) "/threadloom/search?c[users]=1985&tab=0"
["referrer"] => string(59) "https://www.mysite.com/threadloom/do-search"
["_GET"] => array(3) {
["/threadloom/search"] => string(0) ""
["c"] => array(1) {
["users"] => string(4) "1985"
}
["tab"] => string(1) "0"
}
["_POST"] => array(0) {
}
}

And on the front end:​

Oops! We ran into some problems.​

An error occurred while attempt to apply the requested location filter.

I have a valid location in my profile and Google API key works. Nothing in the console either.
 
Does the error occur if you disable some of the add-ons referenced in that stack trace? Specifically, wondering about the Moderator Panel and AMP related ones but if you can try disabling others, that'd help figuring out where the error is coming from.
 
Revisiting this, I've added some changes to harden this a bit that may help.
 
Back
Top