Fatal error : Class ‘String’ not found

How to cite item > ABNT leads to the following error.

Fatal error : Class ‘String’ not found in /home/escijour/public_html/cache/t_compile/%%47^477^47755DDE%%citation.tpl.php on line 25

Did you ever find a solution to your error?

I am seeing the same error as well.

Maybe someone will respond,.

Hi @newone,

What OJS and PHP version are you using? I cannot reproduce the error on my 3.1.2 instance.
On the first glance, it looks like incompatibility issue with PHP 7.

Hi @vitaliy,

I am currently using OJS 2.4.x, and I believe it is PHP 5.6.X. I initially turned on PHP 7 for OJS 2.4.x, but the website was blank, and so I immediately switched back to PHP 5 while I tried to update it. I have a lot of content. I thought that OJS 2.4.x works with PHP 7.

I am trying to get the site updated to OJS 3 this weekend. After that, I have to re-evaluate plans on whether I stay with OJS or move on. Essentially, I need something that is a bit easier to manage, easier to add articles, easier updates, and provide more than 1 option for payment. Additionally, I also need a way to allow people to subscribe to portions of materials, as well as offer options for those that want back issues.

The struggle is for real when you do not have tech support, and looking for an OJS developer is like looking for a needle in a haystack.

I’m not sure but I think OJS 2.4.8-4 supports PHP 7.

If you would have questions regarding OJS, you can always ask here, on the forum. If you are looking for a developer, OJS is written mostly in PHP - it’s quite popular programming language among developers.

Hi @Vitaliy,

I re-checked the compatibility with OJS 2.4.8-4 with PHP 7. I can confirm again that OJS 2.4.8-4 does not work with PHP 7 because there are deprecated features in previous version of PHP 5 that PHP 7 does not support.

For example, these are some of the errors I received:

PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; Application has a deprecated constructor in /public_html/classes/core/Application.inc.php on line 36
[22-May-2019 07:26:22 UTC] PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; PKPApplication has a deprecated constructor in /public_html/lib/pkp/classes/core/PKPApplication.inc.php on line 39
[22-May-2019 07:26:22 UTC] PHP Deprecated:  Non-static method PKPApplication::defineExposedConstant() should not be called statically in /public_html/lib/pkp/classes/core/PKPApplication.inc.php on line 545
[22-May-2019 07:26:22 UTC] PHP Deprecated:  Non-static method PKPApplication::getExposedConstants() should not be called statically in /public_html/lib/pkp/classes/core/PKPApplication.inc.php on line 513
[22-May-2019 07:26:23 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /public_html/lib/pkp/lib/adodb/drivers/adodb-mysql.inc.php:354

I agree that PHP is popular, but finding developers for Open Journal Systems is hard. Developers that use PHP still have to learn how OJS works in order to be able to address whatever issues one is facing. A developer that is very familiar with OJS makes the process easier without the intervention of journal managers. :grinning:

Thanks for responding.

I hope someone chimes in on how to fix this. I too am seeing the error when trying to cite with ABNT format.

If you click “How to cite item” which comes up when looking at an article, the default citation format is ABNT and it produces this error for me:

Fatal error: Class ‘String’ not found in /home/host/public_html/cache/t_compile/%%3F^3FB^3FBCF9BF%%citation.tpl.php on line 18

If someone knows how to fix this, do let me know.

By the way, all the other citation formats such as APA, MLA, works. Just not ABNT.

It’s an old thread, but searching with google finds a lot of OJS-based sites with this error. The cause seems to be the mb_upper function in plugins/citationFormats/abnt/citation.tpl, because the described php Fatal error is preceded with the ojs2 error:

ojs2 has produced an error\n Message: USER ERROR: Smarty error: [in file:/var/www/html/ojs/plugins/citationFormats/abnt//citation.tpl line 22]: [plugin] modifier ‘mb_upper’ is not implemented (core.load_plugins.php, line 36)

We had this error also in our ojs-stable-2_4_8 branch, so I replaced mb_upper function in lines 22 and 26 of plugins/citationFormats/abnt/citation.tpl with mb_strtoupper:

22:

{$author->getLastName()|escape|mb_strtoupper}, {$firstName|escape}{if $middleName} {$middleName|escape}{/if}{if $i<$authorCount-1}; {/if}{/foreach}.

26:

{$authors[0]->getLastName()|escape|mb_strtoupper}, {$firstName|escape}{if $middleName} {$middleName|escape}{/if} et al.

I pushed the changes to my github fork, but I have to figure how to submit a pull request with this specific commit:

1 Like

Thanks @AlesKladnik

It works! :joy:

Works for us too. Thank you!