Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Dancer-Plugin-SimpleCRUD CPAN distribution.

Report information
The Basics
Id: 68120
Status: resolved
Priority: 0/
Queue: Dancer-Plugin-SimpleCRUD

People
Owner: Nobody in particular
Requestors: justincase [...] yopmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.03
Fixed in: (no value)



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};
On 2011-05-11 18:44:07, justincase wrote: Show quoted text
> 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.
Great stuff, thanks Justin! Patch applied, 0.04 making its way to CPAN now. Cheers!