Getting informations in issueToc from IssueData.tpl

Hello everyone,

I’m trying to edit the system for my own. What I need to do, is to get information from editor\issueData on the template \editor\issueToc. So I copy a piece of issueData.tpl:

    <div id="issueId">
{translate key="editor.issues.identification"}

<table width="100%" class="data">
{if count($formLocales) < 1}
	<tr valign="top">
		<td width="20%" class="label">{fieldLabel name="formLocale" key="form.formLanguage"}</td>
		<td width="80%" class="value">
			{url|assign:"issueUrl" op="issueToc" path=$issueId escape=false}
			{form_language_chooser form="issue" url=$issueUrl}
			<span class="instruct">{translate key="form.formLanguage.description"}</span>
		</td>
	</tr>
{/if}

<tr valign="top">
	<td width="20%" class="label">{fieldLabel name="volume" key="issue.volume"}</td>
	<td width="80%" class="value"><input type="text" name="volume" id="volume" value="{$volume|escape}" size="5" maxlength="5" class="textField" /></td>
</tr>
<tr valign="top">
	<td class="label">{fieldLabel name="number" key="issue.number"}</td>
	<td class="value"><input type="text" name="number" id="number" value="{$number|escape}" size="5" maxlength="10" class="textField" /></td>
</tr>
<tr valign="top">
	<td class="label">{fieldLabel name="year" key="issue.year"}</td>
	<td class="value"><input type="text" name="year" id="year" value="{$year|escape}" size="5" maxlength="4" class="textField" /></td>
</tr>

into issueToc.tpl, then I updated the function issueToc() in IssueManagementHandler.inc.php with the content of function issueData() - all content of issueData copied before

$templateMgr->display('editor/issues/issueToc.tpl');

Now I’m getting error, that i don’t understand:

Fatal error: Call to a member function getIssueIdentification() on a non-object in C:\xampp\htdocs\ojs245\cache\t_compile\%%72^72A^72A158C2%%issueToc.tpl.php on line 5

I understand, what the error means, but in the updated issueToc function isn’t used. Where should i found the problem. Any suggestions which make me clear, how it is processed? Thanks a lot.

duff

Hi @duff,

It’s hard to know what’s happening based on what you’ve included here; if you’re willing to put your code up on a fork of OJS’s repository on github.com, perhaps I could take a look.

Regards,
Alec Smecher
Public Knowledge Project Team

here is updated files - (default OJS 2.4.5)

i will prepare it for github. thanks a lot.

duff

I’ve tried to get it on the github, i don’t know, if it’s ok. Thanks.

duff

Hi @duff,

If it’s committed properly to github, it should show only your changes to the built-in IssueManagementHandler.inc.php, not the whole file. This makes it easy to see what’s been added.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher,

now, it should be commited properly - I’ve used ojs 245 stable and edited the file IssueManagementHandler.inc.php. If i would like to commit changes in another file, I need to do it separately, right?

Thanks a lot,

duff

I got it :). I overlooked some fault :).