[rt-devel] Keyword brainfart

ivan ivan-rt-devel at 420.am
Mon Apr 2 12:32:06 EDT 2001


Here's an example of why it's a bad idea to fiddle code gratuitously.
This should be obvious; let me know if you need further explanation.

Index: Keyword.pm
===================================================================
RCS file: /proj/maps/cvsroot/rt/lib/RT/Keyword.pm,v
retrieving revision 1.1.2.3
retrieving revision 1.12
diff -u -b -r1.1.2.3 -r1.12
--- Keyword.pm  2001/04/02 16:25:11     1.1.2.3
+++ Keyword.pm  2001/03/20 09:13:39     1.12
@@ -311,10 +310,7 @@
        $results{ $Keyword->id } = $Keyword->Name;
                
        if ( $generations == 0 || $generations > 1 ) {
-           #if we're limiting to some number of generations,
-           # decrement the number of generations
-           $generations-- if ( $generations > 1 );
-           my $kids = $Keyword->Descendents($generations, \%results);
+           my $kids = $Keyword->Descendents($generations-1, \%results);
            
            foreach my $kid ( keys %{$kids}) {
                $results{"$kid"} = $Keyword->Name. "/". $kids->{"$kid"};




-- 
meow
_ivan




More information about the Rt-devel mailing list