Commit b7c58854 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic
Browse files

Bug 1800961: php foreach should only be used on arrays

trying to use any other type of variable will
throw an exception.
Also, block types and view types should not be
nested in the template


Change-Id: I1ea1e3fc9e7ba7734e1b5712467678c001806e65
parent 1a81d018
......@@ -206,11 +206,13 @@ function site_statistics($full=false) {
ORDER BY blocks DESC",
array(), 0, $maxblocktypes
if (is_array($blocktypecounts)) {
foreach ($blocktypecounts as $blocktype) {
safe_require('blocktype', $blocktype->blocktype);
$classname = generate_class_name('blocktype', $blocktype->blocktype);
$blocktype->title = $classname::get_title();
$smarty->assign('blocktypecounts', $blocktypecounts);
$smarty->assign('viewtypes', true);
......@@ -8,7 +8,8 @@
<li class="list-group-item">{$item->title}: {$item->blocks}</li>
{if $viewtypes}
{if $viewtypes}
<h4>{str tag=viewsbytype section=admin}</h4>
<div class="panel-body">
<canvas class="graphcanvas" id="sitestatsviewtypesgraph"></canvas>
......@@ -20,5 +21,4 @@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment