pkp / bootstrap3

A community-built theme for OJS 3 that implements Bootstrap 3 components.
GNU General Public License v3.0
55 stars 98 forks source link

Bootstrap3 Theme PHP Fatal Error on indexSite.tpl #195

Closed rshost closed 1 year ago

rshost commented 1 year ago

Describe the bug

When calling the OJS index site with Bootstrap3 theme plugin (version 3.2.0.4 from plugin gallery) enabled, the following PHP Fatal Error is produced:

PHP Fatal error: Uncaught Error: Call to a member function eof() on array in /var/www/html/ojs/lib/pkp/classes/template/PKPTemplateManager.inc.php:1447 ...

This originates from line 50 in indexSite.tpl iterating over all journals:

{iterate from=journals item=journal}

Indeed line 80 in IndexHandler.inc.php passes on an array:

'journals' => $journalDao->getAll(true)->toArray(), ,

while PKPTemplateManager.inc.php -> smartyIterate seems to expect an iterator:

$iterator = $smarty->getTemplateVars($params['from']);

The default index site uses {foreach from=$journals item=journal} instead.

Looking through the Bootstrap3 repo the main branch and the branch stable-3_3_0 (which according to version.xml is 3.2.0.3) both use {foreach ...}. I couldn't find a version 3.2.0.4 in the repo. To me it looks like the archive the plugin gallery points to should be updated.

To Reproduce Steps to reproduce the behavior:

  1. Enable Bootstrap3 Theme Plugin
  2. Go to index site
  3. See error

What application are you using? OJS version 3.3.0-11

NateWr commented 1 year ago

@asmecher this is fixed in the repository. It looks like the bootstrap3 theme needs a release from the stable-3_3_0 branch to support 3.3.x. Is that something you can do fairly quickly? Or would you rather wait until we have time to fix a few more issues for it?

asmecher commented 1 year ago

I've released a new build of bootstrap3; is this issue ready to be closed?

rshost commented 1 year ago

Thanks for the quick fix!