Changeset 1419

Show
Ignore:
Timestamp:
02/28/08 01:38:39 (21 months ago)
Author:
breese
Message:

fixed bug:69143 - XMLRPCServer.pm would croak if user attempted to post an entry with no categories assigned

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-30/lib/MT/XMLRPCServer.pm

    r1174 r1419  
    235235    } 
    236236    elsif (my $cats = $item->{categories}) { 
    237         my $cat_class = MT->model('category'); 
    238         # The spec says to ignore invalid category names. 
    239         @categories = grep { defined } $cat_class->search({ 
    240             blog_id => $entry->blog_id, 
    241             label   => $cats, 
    242         }); 
     237        if (@$cats) { 
     238            my $cat_class = MT->model('category'); 
     239            # The spec says to ignore invalid category names. 
     240            @categories = grep { defined } $cat_class->search({ 
     241                blog_id => $entry->blog_id, 
     242                label   => $cats, 
     243            }); 
     244        } 
    243245    } 
    244246