summaryrefslogtreecommitdiff
path: root/modules/tag
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-01 23:00:10 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-01 23:00:10 -0700
commit91c7eb120023ab3d8e1511af6c9f6b6c1109232e (patch)
treeb450888bd524c09c706a0f5a7af3a4ea0d6426f9 /modules/tag
parent43abcd93867996e32890fa101ae09255ccc24847 (diff)
Don't throw an error if there are no visible tags.
Diffstat (limited to 'modules/tag')
-rw-r--r--modules/tag/controllers/tags.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index 930c1252..295a9d3b 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -27,16 +27,16 @@ class Tags_Controller extends REST_Controller {
$offset = ($page-1) * $page_size;
// Make sure that the page references a valid offset
- if ($page < 1 || $page > ceil($children_count / $page_size)) {
+ if ($page < 1 || ($children_count && $page > ceil($children_count / $page_size))) {
Kohana::show_404();
}
$template = new Theme_View("page.html", "tag");
- $template->set_global('page_size', $page_size);
- $template->set_global('page_title', t("Browse Tag::%name", array("name" => $tag->name)));
- $template->set_global('tag', $tag);
- $template->set_global('children', $tag->items($page_size, $offset));
- $template->set_global('children_count', $children_count);
+ $template->set_global("page_size", $page_size);
+ $template->set_global("page_title", t("Browse Tag::%name", array("name" => $tag->name)));
+ $template->set_global("tag", $tag);
+ $template->set_global("children", $tag->items($page_size, $offset));
+ $template->set_global("children_count", $children_count);
$template->content = new View("dynamic.html");
print $template;