From ca92ca7ec5a2e5b348e259583e0dda6b7571fcf9 Mon Sep 17 00:00:00 2001 From: dakkar Date: Thu, 20 Oct 2005 13:06:51 +0000 Subject: ancora non inserisce le icone: se si fa bind_param($pos,$blob_data,DBI::SQL_BLOB) funziona, ma se fa bind_param($pos,undef,DBI::SQL_BLOB);execute($blob_data) non va. Peccato che Class::DBI faccia la seconda cosa... --- lib/Bookmarks/M/DB/Links.pm | 2 +- lib/Bookmarks/M/DB/Tags.pm | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/Bookmarks') diff --git a/lib/Bookmarks/M/DB/Links.pm b/lib/Bookmarks/M/DB/Links.pm index 3ae761d..92fd74b 100644 --- a/lib/Bookmarks/M/DB/Links.pm +++ b/lib/Bookmarks/M/DB/Links.pm @@ -11,7 +11,7 @@ for my $col_name (qw(add_date last_access_date)) { __PACKAGE__->has_many( tags => ['Bookmarks::M::DB::LinksTags' => 'tag'] ); -__PACKAGE__->data_type( icon => DBI::SQL_BINARY ); +__PACKAGE__->data_type( icon => DBI::SQL_BLOB ); =head1 NAME diff --git a/lib/Bookmarks/M/DB/Tags.pm b/lib/Bookmarks/M/DB/Tags.pm index c1e1f0b..732c8b7 100644 --- a/lib/Bookmarks/M/DB/Tags.pm +++ b/lib/Bookmarks/M/DB/Tags.pm @@ -40,7 +40,11 @@ sub get_all_tags_by_popularity { sub ordered_links { my ($self)=@_; my @links=$self->links(); - return sort {$a->access_count <=> $b->access_count} @links; + return sort { + ($a->access_count || 0) + <=> + ($b->access_count || 0) + } @links; } =head1 NAME -- cgit v1.2.3