From 3890429d05d44d52c311efcd7ca726134fffb40d Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sat, 30 Aug 2008 19:57:56 +0200 Subject: [PATCH] Import deletes correctly --- PciIds/Html/Tables.pm | 5 ++++- scripts/importil.pl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/PciIds/Html/Tables.pm b/PciIds/Html/Tables.pm index 2e916b3..4eab1b3 100644 --- a/PciIds/Html/Tables.pm +++ b/PciIds/Html/Tables.pm @@ -20,7 +20,10 @@ sub nodes( $$$ ) { my $restrict = $args->{'restrict'}; $restrict = '' unless( defined $restrict ); $restrict = PciIds::Address::new( $parent )->restrictRex( $restrict );#How do I know if the restrict is OK? - htmlFormatTable( PciIds::DBQ::nodes( $self, $parent, $args, $restrict ), 3, [], [ \&formatLink ], sub { 1; }, sub { return ' class="'.( defined( shift->[ 3 ] ) ? 'item' : 'unnamedItem' ).'"'; } ); + htmlFormatTable( PciIds::DBQ::nodes( $self, $parent, $args, $restrict ), 3, [], [ \&formatLink ], sub { 1; }, sub { + my $name = shift->[ 1 ]; + return ' class="'.( defined $name && $name ne '' ? 'item' : 'unnamedItem' ).'"'; + } ); } 1; diff --git a/scripts/importil.pl b/scripts/importil.pl index 4f21c85..7234831 100755 --- a/scripts/importil.pl +++ b/scripts/importil.pl @@ -65,7 +65,7 @@ sub getUser( $ ) { sub addComment( $$$$$ ) { my( $email, $time, $name, $comment, $discussion ) = @_; my $user = getUser( $email ); - $name = undef if( ( defined $name ) && $name !~ /\S/ ); + $name = undef if( ( defined $name ) && $name !~ /\S/ && $name ne '' ); $comment = undef if( ( defined $comment ) && $comment !~ /\S/ ); $discussion = undef if( ( defined $discussion ) && $discussion !~ /\S/ ); $newcomment->execute( $user, $addr->get(), $time, $name, $comment, $discussion ); -- 2.39.2