Not a bug [After Upgrade] Template error: Method canLike is not callable on the given object (XFRM\Entity\ResourceUpdate) src/XF/Template/Templater.php:972

Earl

Well-known member
Affected version
2.1.0 Preview 1
ErrorException: Template error: Method canLike is not callable on the given object (XFRM\Entity\ResourceUpdate) src/XF/Template/Templater.php:972
xQsoW6Ll.png

Stack Trace

Code:
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canLike ...', 'src/XF/Tem...', 972, Array)
#1 src/XF/Template/Templater.php(972): trigger_error('Method canLike ...', 512)
#2 internal_data/code_cache/templates/l1/s1/public/xfrm_resource_view.php(197): XF\Template\Templater->method(Object(XFRM\Entity\ResourceUpdate), 'canLike', Array)
#3 src/XF/Template/Templater.php(1293): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#4 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfrm_resource_v...', Array)
#5 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#6 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XFRM:ResourceIt...', 'public:xfrm_res...', Array)
#7 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#8 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#10 src/XF/App.php(2155): XF\Mvc\Dispatcher->run()
#11 src/XF.php(389): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}
Request state
Code:
<pre class='xdebug-var-dump' dir='ltr'>
<small>/app/src/XF/Debugger.php:28:</small>
<b>array</b> <i>(size=4)</i>
'url' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'/index.php?resources/test-resource-72.113/'</font> <i>(length=42)</i>
'referrer' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'http://localhost/index.php?resources/categories/mobiles.3/add'</font> <i>(length=61)</i>
'_GET' <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=1)</i>
'resources/test-resource-72_113/' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>''</font> <i>(length=0)</i>
'_POST' <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=0)</i>
<i><font color='#888a85'>empty</font></i>
</pre>
 
Okay, I restored from the backup, and deleted all added styles in 2.0 version and disabled every add-on (xf-addon:disable) in order to upgrade xf 2.1 preview beta 2 (xf:upgrade) then again, extracted the XFRM preview beta 1 zip and executed xf-addon:upgrade XFRM
Still getting the same error
 
Do you have an aggressive opcode cache configured?

The template being loaded definitely looks like the 2.0 version. If you are doing CLI actions, then we can't do opcode refreshes, so if you have a configuration that doesn't watch for changes frequently, then that could cause the old version of the template to be served.
 
Do you have an aggressive opcode cache configured?

The template being loaded definitely looks like the 2.0 version. If you are doing CLI actions, then we can't do opcode refreshes, so if you have a configuration that doesn't watch for changes frequently, then that could cause the old version of the template to be served.
hmmm
Code:
<?php


$config['db']['host'] = 'xf2-dev_xf2db_1_4c4a73e07c7c';

$config['db']['port'] = '3306';

$config['db']['username'] = 'root';

$config['db']['password'] = 'devpw';

$config['db']['dbname'] = 'defaultxf';


$config['fullUnicode'] = true;


$config['cookie']['prefix'] = 'xf2dev_';


$config['development']['enabled'] = true;

$config['development']['defaultAddOn'] = 'Earl/RelatedSearchResults';

This is the config.php file
I will restore the backup again, and upgrade it with browser and update this thread again in 5 minute.
 
Sorry It took more than 5 minutes.
This time I restored from the backup, disabled developer mode, executed the upgrade command via web browser. Then deleted every added styles, and extracted the XFRM preview beta 1 zip and upgraded using web browser.
Okay... The error disappeared. :unsure:
 
I'm guessing you had development data for the RM that didn't get updated -- more specifically, I guess you actually had development data there so when you did the CLI upgrade, it took that as the latest data and ignored the data in the XML files. That is really as expected in this instance, as the dev data is treated as being more recent, but that doesn't really apply if you mix and match the approach taken. In that case, the web upgrade will always use the XML data so it may be safer.
 
Ahaa, so that's the case. Thank you for the brief explanation. :)
And I'm sorry for assuming this as a bug and reporting here.
 
Hi, i'm receiving the same error, the log is full of this error.

Code:
ErrorException: Template error: Method canLike is not callable on the given object (XFRM\Entity\ResourceUpdate) src/XF/Template/Templater.php:980
Generated by: poel 17 Settembre 2019 alle 21:52
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canLike ...', '/home/imynrsub/...', 980, Array)
#1 src/XF/Template/Templater.php(980): trigger_error('Method canLike ...', 512)
#2 internal_data/code_cache/templates/l4/s11/public/xfrm_resource_view.php(189): XF\Template\Templater->method(Object(XFRM\Entity\ResourceUpdate), 'canLike', Array)
#3 src/XF/Template/Templater.php(1301): XF\Template\Templater->{closure}(Object(ThemeHouse\UIX\XF\Template\Templater), Array)
#4 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfrm_resource_v...', Array)
#5 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#6 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XFRM:ResourceIt...', 'public:xfrm_res...', Array)
#7 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#8 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#10 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#11 src/XF.php(390): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}
 
Hi, i'm receiving the same error, the log is full of this error.

Code:
ErrorException: Template error: Method canLike is not callable on the given object (XFRM\Entity\ResourceUpdate) src/XF/Template/Templater.php:980
Generated by: poel 17 Settembre 2019 alle 21:52
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canLike ...', '/home/imynrsub/...', 980, Array)
#1 src/XF/Template/Templater.php(980): trigger_error('Method canLike ...', 512)
#2 internal_data/code_cache/templates/l4/s11/public/xfrm_resource_view.php(189): XF\Template\Templater->method(Object(XFRM\Entity\ResourceUpdate), 'canLike', Array)
#3 src/XF/Template/Templater.php(1301): XF\Template\Templater->{closure}(Object(ThemeHouse\UIX\XF\Template\Templater), Array)
#4 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xfrm_resource_v...', Array)
#5 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#6 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XFRM:ResourceIt...', 'public:xfrm_res...', Array)
#7 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#8 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#10 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#11 src/XF.php(390): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}

You either have an outdated template or addon. Most likely your UIX style is outdated.
 
Please help.
ErrorException: Template error: [E_USER_WARNING] Method canLike is not callable on the given object (Nulumia\SeoTools\XF\Entity\Post) src/XF/Template/Templater.php:1186
 
If you require support, you will need to link your forum user name with your license and post in the relevant forum.
 
Back
Top Bottom