Fatal error: userProfile.tpl.php on line 58

Hello,

My OJS install throws the following error when I click on http://journals.domain.com/index.php/journal-name/manager/userProfile/873… :

Fatal error: Call to undefined method User::getDegree() in /home/cpanelusername/public_html/journals.domain.com/cache/t_compile/%%C4^C49^C498A7FD%%userProfile.tpl.php on line 58

OJS version: 2.4.8.1

Any ideas on what would be the reasons for this?

Thank you.

Regards,
D

Hi @Dragomir,

I think this must be a local modification to your system. Check templates/manager/people/userProfile.tpl.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thank you for your answer.

I checked templates/manager/people/userProfile.tpl and getDegree() looks similarly to the other ones. Here’s an example:

	</tr>
	<tr valign="top">
		<td class="label">{translate key="user.lastName"}</td>
		<td class="value">{$user->getLastName()|escape|default:"&mdash;"}</td>
	</tr>
	
	
	<tr valign="top">
		<td class="label">{translate key="user.degree"}</td>
		<td class="value">{$user->getDegree()|escape|default:"&mdash;"}</td>
	</tr>
	
	
	<tr valign="top">
		<td class="label">{translate key="user.affiliation"}</td>
		<td class="value">{$user->getLocalizedAffiliation()|escape|nl2br|default:"&mdash;"}</td>
	</tr>

Is there anything else I should check?

Regards,
Dragomir

Hi again,

In addition, I have the following on line 58 in /home/cpanelusername/public_html/journals.domain.com/cache/t_compile/%%C4^C49^C498A7FD%%userProfile.tpl.php:

		<td class="value"><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['user']->getDegree())) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp)))) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;")); ?>
</td>

Regards,
D

Hi @Dragomir,

That piece of userProfile.tpl (and the resulting automatically-generated code in the template cache you also quoted) are not official OJS code – they look like a modification someone has made to your system.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like