Changeset 2314
- Timestamp:
- 05/13/08 17:43:45 (21 months ago)
- Files:
-
- 1 modified
-
branches/release-38/lib/MT/Category.pm (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-38/lib/MT/Category.pm
r2275 r2314 9 9 use strict; 10 10 use base qw( MT::Object ); 11 use MT::Util qw( weaken ); 11 12 12 13 use MT::Blog; … … 76 77 return $cat->{__path} if exists $cat->{__path}; 77 78 my $result = $cat->basename; 79 my $orig = $cat; 78 80 do { 79 # TODO: uh, does this not mean we cache the resulting path on the80 # root category object instead?81 81 $cat = $cat->parent ? __PACKAGE__->load($cat->parent) : undef; 82 82 $result = join "/", $cat->basename, $result if $cat; … … 84 84 # caching this information may be problematic IF 85 85 # parent category basenames are changed. 86 $ cat->{__path} = $result;86 $orig->{__path} = $result; 87 87 } 88 88 *category_path = \&publish_path; … … 92 92 return $cat->{__label_path} if exists $cat->{__label_path}; 93 93 my $result = $cat->label =~ m!/! ? '[' . $cat->label . ']' : $cat->label; 94 my $orig = $cat; 94 95 do { 95 96 $cat = $cat->parent ? __PACKAGE__->load($cat->parent) : undef; … … 99 100 # caching this information may be problematic IF 100 101 # parent category labels are changed. 101 $ cat->{__label_path} = $result;102 $orig->{__label_path} = $result; 102 103 } 103 104 … … 389 390 unless ($cat->{__parent_category}) { 390 391 $cat->{__parent_category} = ($cat->parent) ? $class->load($cat->parent) : undef; 392 weaken( $cat->{__parent_category} ); 391 393 } 392 394 $cat->{__parent_category}; … … 400 402 $class->load({ blog_id => $cat->blog_id, 401 403 parent => $cat->id }); 404 weaken( $_ ) foreach @{ $cat->{__children} }; 402 405 } 403 406 @{$cat->{__children}};
