]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* postsparkline: Avoid a confusing error message if no pages match
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 25 Oct 2007 03:07:39 +0000 (23:07 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 25 Oct 2007 03:07:39 +0000 (23:07 -0400)
  and instead show an empty graph.

IkiWiki/Plugin/postsparkline.pm
debian/changelog

index ac7ad9d73b7c6fb6a5c7f26e05ce2b598ef6177d..dc996ae32ff3f877f7f0963bc6aa2f29893937c0 100644 (file)
@@ -56,6 +56,11 @@ sub preprocess (@) { #{{{
                return "[[postsparkline error $@]]";
        }
 
                return "[[postsparkline error $@]]";
        }
 
+       if (! @data) {
+               # generate an empty graph
+               push @data, 0 foreach 1..$params{max};
+       }
+
        my $color=exists $params{color} ? "($params{color})" : "";
 
        delete $params{pages};
        my $color=exists $params{color} ? "($params{color})" : "";
 
        delete $params{pages};
index 9ae87ca78f47bb81e6127eecf69558c0e27460a1..bc2ca4920fa5cfd5e17724e2bdb8946929939d21 100644 (file)
@@ -11,8 +11,10 @@ ikiwiki (2.11) UNRELEASED; urgency=low
   * Removed manual ctime statting code, and just have the calendar plugin use
     %pagectime.
   * Ikiwiki has moved into a git repository.
   * Removed manual ctime statting code, and just have the calendar plugin use
     %pagectime.
   * Ikiwiki has moved into a git repository.
+  * postsparkline: Avoid a confusing error message if no pages match
+    and instead show an empty graph.
 
 
- -- Joey Hess <joeyh@debian.org>  Wed, 24 Oct 2007 22:19:31 -0400
+ -- Joey Hess <joeyh@debian.org>  Wed, 24 Oct 2007 22:58:51 -0400
 
 ikiwiki (2.10) unstable; urgency=low
 
 
 ikiwiki (2.10) unstable; urgency=low