Can't show current issue with articles on homepage (Oldgregg plugin)

Hi, I’m new to the forum and I have a problem; I haven’t been able to show the latest issue (current) with its respective articles. I know the default template has this feature, but the site I’m working on uses the oldGregg theme, which doesn’t show the current issue in detail, and cannot be changed.

I grafted the code that makes it happen in the original indexJournal.tpl into the oldGregg indexJournal.tpl, with mixed results.

here’s the code:

{* Latest issue *}
{if $issue}
	<div class="current_issue">
		<h2>
			{translate key="journal.currentIssue"}
		</h2>
		<div class="current_issue_title">
			{$issue->getIssueIdentification()|strip_unsafe_html}
		</div>
		{include file="frontend/objects/issue_toc.tpl"}
		<a href="{url router=$smarty.const.ROUTE_PAGE page="issue" op="archive"}" class="read_more">
			{translate key="journal.viewAllIssues"}
		</a>
	</div>
{/if}

it does show the issue name and publication date, but fails to show its associated articles; I get a fatal PHP error:

PHP Fatal error: Cannot use object of type PublishedArticle as array in /home/revistaestudiosh/public_html/ojs/cache/t_compile/6267f877acd9b945f8a07db7bb24329a969a952a^%%DD^DDF^DDF03D78%%issue_toc.tpl.php on line 87

I tracked down the file and got down to line 87:

52

and I don’t know what to make of it.

I know the issue arises whenever the line {include file=“frontend/objects/issue_toc.tpl”} is called. If I remove said line, the error goes away. But this same line works fine because it feeds the /issue/current/ page.

I don’t know how to solve this problem because of my limited PHP/Smarty knowledge.
If you need more files I will provide them.
Any help will be much appreciated. Thank you in advance.

Hi @luchosoto,

Probably that’s because of overlapping variable name. The theme assigns an array $publishedArticles to the journal index name and it overrides in this case identical variable in the issue_toc template. So, the easiest way is to rename it here: https://github.com/Vitaliy-1/oldGregg/blob/master/OldGreggThemePlugin.inc.php#L247 and inside indexJournal.tpl.

Thank you. It worked like a charm.

SOLVED.

I have installed the Oldgreg theme in OJS 3.3.0.6. Working fine. But when you click on the title of the article, it is supposed to show the full text, but it does not. Any idea. Looks like the built-in JATSparser is not working well???.

Hi @Alireza_Mosavi_Jarra,

This is quite an older post and not likely being actively monitored. Can you create a new post and post your question there? Please include the version of OJS and the version of the theme that you’re using.

Best regards,

Roger
PKP Team