From: Michal Vaner Date: Sat, 30 Aug 2008 17:57:56 +0000 (+0200) Subject: Import deletes correctly X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=3890429d05d44d52c311efcd7ca726134fffb40d;p=pciids.git Import deletes correctly --- 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 );