Hello, im using OJS 3.1.2 Version and was about to check Usage Statistic plugin because view and download report is not running. And when i tried to check on Usage Statistic plugin setting turns out there was invalid JSON.
And here is the log, there’s PHP Fatal error:
PHP Fatal error: Call to undefined method UsageStatsPlugin::getTemplateResource in UsageStatsSettingsForm.inc.php on line 30
Kindly please help me about this issue. Thank you
Regards
Hi @Prasetya_Aditya
Did you recently upgrade OJS? That method is defined in lib/pkp/classes/plugins/Plugin.inc.php and should be present if you’ve also upgraded the pkp-lib library with your installation. Can you look in that file to see if the method is present?
Cheers,
Jason
Hello @jnugent, thanks for your response.
First of all, sorry i have little knowledge about code. But is this method that you mean in Plugin.inc.php?
public function getTemplateResourceName($inCore = false) {
$pluginPath = $this->getPluginPath();
if ($inCore) {
$pluginPath = PKP_LIB_PATH . DIRECTORY_SEPARATOR . $pluginPath;
}
$plugin = basename($pluginPath);
$category = basename(dirname($pluginPath));
return join(’/’, array(PLUGIN_TEMPLATE_RESOURCE_PREFIX, $pluginPath, $category, $plugin));
}
Hi @Prasetya_Aditya
No, that method is getTemplateResourceName
. You’d want to find one named getTemplateResource
If it’s not there, then there is a problem with your lib-pkp library.
Cheers,
Jason
Hello @jnugent
Yes ive checked and there is no getTemplateResource method in the plugin.inc.php
So what should i do?
Hi @Prasetya_Aditya
how did you install OJS 3.1.2? It sounds like you have a mix of two versions together.
Regards
Jason