Subject: | Warning on tables with no records |
When a database table has no records HTML::Table will return undef and
SimpleCRUD will barf:
Warning caught during route execution: Use of uninitialized value in
concatenation (.) or string at
/usr/lib64/perl5/vendor_perl/5.12.3/Dancer/Plugin/SimpleCRUD.pm line
496, <DATA> line 16.
Simple patch attached.
Subject: | simplecrud-no-records.patch |
--- SimpleCRUD.pm.orig 2011-05-11 10:37:28.957220902 -0700
+++ SimpleCRUD.pm 2011-05-11 10:40:56.334340705 -0700
@@ -493,7 +493,7 @@
],
);
- $html .= $table->getTable;
+ $html .= $table->getTable || '';
$html .= sprintf '<a href="%s">Add a new %s</a></p>',
$args->{prefix} . '/add', $args->{record_title};