"Recommend Articles by Author"-Plugin error with OJS 3.2.0-1

Hello there,

I’m very sorry to bother you again. I haven’t found anything about this problem either in the forum or in github, so I think maybe this isn’t known yet. Anyway I noticed that if I activate the “Recommend Articles by Author”-Plugin in OJS 3.2.0-1 it only works if every article the author has written is published. If one article isn’t publish yet, I receive this error:

PHP Fatal error: Uncaught Error: Call to a member function getJournalId() on null in C:\xampp\htdocs\ojs3\classes\issue\IssueAction.inc.php:31\nStack trace:\n#0 C:\xampp\htdocs\ojs3\classes\search\ArticleSearch.inc.php(274): IssueAction->subscriptionRequired(NULL, Object(Journal))\n#1 C:\xampp\htdocs\ojs3\plugins\generic\recommendByAuthor\RecommendByAuthorPlugin.inc.php(137): ArticleSearch->formatResults(Array)\n#2 C:\xampp\htdocs\ojs3\lib\pkp\classes\plugins\HookRegistry.inc.php(107): RecommendByAuthorPlugin->callbackTemplateArticlePageFooter(‘Templates::Arti…’, Array)\n#3 C:\xampp\htdocs\ojs3\lib\pkp\classes\template\PKPTemplateManager.inc.php(1237): HookRegistry::call(‘Templates::Arti…’, Array)\n#4 C:\xampp\htdocs\ojs3\cache\t_compile\42362804174f266c598cdb32c3208fc745b92101^1c372c95cd85572e0fbc9a53d0323a0b229cfc78_0.app.frontendpagesarticle.tpl.php(43): PKPTemplateManager->smartyCallHook(Array, Object(Smarty_Internal_Template))\n#5 C:\xampp\htdocs\ojs3\lib\pkp\lib\vendor\smarty\smarty\libs\sysplugins\smarty_template_resource in C:\xampp\htdocs\ojs3\classes\issue\IssueAction.inc.php on line 31

Edit: I noticed it’s enough to add the article to an issue, but you don’t have to publish it. Anyway, the problem remains that articles without having an issue lead to this error.

Kind regards
Daniela

Hi @UBWolf,

Unfortunately I can’t replicate that behaviour locally. Can you try clearing your database cache? If you’d like to investigate further, I think the relevant query is implemented in classes/search/ArticleSearchDAO.inc.php – as you’ll note, the query uses retrieveCached, which uses ADODB’s result caching mechanism.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I’m not sure how to flush the cache in my local xampp installation :flushed: But I’ll see what I can do. In the meantime I realized I forgot to give you an important information: I created all articles with the quick submit plugin. I try it again the normal way and look if the behaviours is identical.

Edit: With the normal way I don’t have the problem, so I think it has something to do with the quick submit plugin. Could you try again with the plugin? Maybe then you can replicate the behaviour.

Edit #2: Another user has the same problem: Error: the article display is different from the others - #6 by UBWolf

Kind regards
Daniela

Hi all,

Thanks, @UBWolf; I’ll lock this thread so the conversation can continue on the other one: Error: the article display is different from the others - #7 by asmecher

Regards,
Alec Smecher
Public Knowledge Project Team