We have this problem in which our theme is working just fine in our production site, but this site is runing on PHP 5.6, which is outdated.
We want to upgrade to PHP 7, and we had install OJS 3.1.2 with PHP 7.2 in our dev site.
The problem comes in the public site of our dev site. There’s no frontend at all. I have tried like 5 different themes for OJS 3.1.1+ or 3.1+ that I saw in another thread, but none of those are working.
There’s a guide to develop a new theme for OJS 3.1.2+? Or there’s something that we need to know or change for the theme to work?
Hi!
Can You check with default theme of the OJS (to rule out any issue with the theme itself) and driver setting in config.inc.php file under ::database settings:: driver = mysqli
OJS 3.1.2 introduced Smarty V3 and so many themes needed a rework and small modifications to get working correctly again. You may want to look in your PHP error logs to find out what the cause is, exactly.
I’ve reviewed our PHP error logs but there’s only one Warning but I don’t think that this warning is causing the site to breakdown… There’s a guide to make a rework of our themes with Smarty V3 that you can handle me, please?
If it’s a Smarty error, there should be appropriate mention in the log. On the top of my mind, in Smarty 3 was excluded {php} tag and several built-in functions renamed, like get_template_vars to getTemplateVars. Some info can be found here: https://raw.githubusercontent.com/smarty-php/smarty/master/SMARTY_2_BC_NOTES.txt. But once again, all incompatibilities should be reflected in PHP logs. You can also check the level of error reporting in php.ini.
Are you trying to run official themes or custom ones?
I was trying at first with one of our custom themes, but recently I tried with themes that I found on a Thread here in the forum and those doesn’t work either.
The only message related to a PHP error on the logs is: AH01071: Got error 'PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/test.summapsicologica.cl/httpdocs/cache/t_compile/65bfc3e024c2e9104f46e23b73376a9455e3df0e^51cfb9321c891ada9323e7942962579e7e4324d1_0.app.frontendpagesindexSite.tp.php on line 43\n'
Apologies, I was travelling. Looking back to your original post, when you say “no front end at all”, do you mean completely blank pages, or just unstyled content? Unstyled content may mean something other than your theme not being compatible with 3.1.2. Does the very basic default OJS 3 theme work if it is enabled?
You’re right, there’s content on the pages but it’s unstyled content. The default OJS 3 theme does work correctly, but none of the others work. We’re reviewing the code for changes in the Smarty syntax.
The default theme should definitely work in 3.1.2.4. It’s part of the OJS core. I’d try clearing caches first, and looking in your error logs for detailed PHP problems. When you jumped to 3.1.2.4 did you also increase your PHP version? 3.1.2.4 requires PHP7.2. Older versions of OJS got by with PHP5.6.
Off the top of my head, the main thing that broke in older themes when Smarty was updated to version 3 were places where the template included embedded PHP code, like
{php}break;{/break}
or
{php}continue;{/continue}
Those needed to be changed to the Smarty equivalents, like {break} and {continue}.
This sort of thing would show up in the PHP error log, though. Anything in there at all?
I’m reviewing the code but in the error logs there’s no error related to PHP, just warnings like
AH01071: Got error 'PHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/test.summapsicologica.cl/httpdocs/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1581\n
PHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/test.summapsicologica.cl/httpdocs/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1581\n', referer: http://test.summapsicologica.cl/index.php/summatest/login
If you’re getting unstyled content, but not blank pages, PHP isn’t generating fatal errors, so it’s probably the theme itself, not being loaded. Out of curiosity, what version of OJS are you using?
The only theme that works is the default theme. There’s no other theme working on the devsite (in which we’re working). The devsite is running in Plesk with PHP 7.2.
Which version of 3.1.2, though? 3.1.2 came out nearly a year ago, and there have been point releases for it as recent as just a few weeks ago. Lots of bug fixes since the first version
Cheers,
Jason
I was trying to login to te site but I can’t. The user and pass are both correct (change the pass througt email) and the problem remains, I can’t acces to the admin dashboard.
We haven’t done any change on the code.
We have OJS 3.1.2.1 and I’m dowloading the themes, loading into the /plugins/theme folder, unzip it and then selecting them within the admin dashboard.
AH01071: Got error 'PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/test.summapsicologica.cl/httpdocs/cache/t_compile/65bfc3e024c2e9104f46e23b73376a9455e3df0e^51cfb9321c891ada9323e7942962579e7e4324d1_0.app.frontendpagesindexSite.tp.php on line 43\n', referer: http://test.summapsicologica.cl/index.php/index/login