From: <mv...@tr...> - 2004-11-09 20:41:14
|
Log Message: ----------- fixed bug that caused ISE if category not matching site was in root of archive and 'create catetgories' option selected. Modified Files: -------------- krang/lib/Krang/CGI/Media: BulkUpload.pm Revision Data ------------- Index: BulkUpload.pm =================================================================== RCS file: /usr/local/krang-cvs/krang/lib/Krang/CGI/Media/BulkUpload.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -Llib/Krang/CGI/Media/BulkUpload.pm -Llib/Krang/CGI/Media/BulkUpload.pm -u -r1.15 -r1.16 --- lib/Krang/CGI/Media/BulkUpload.pm +++ lib/Krang/CGI/Media/BulkUpload.pm @@ -281,6 +281,13 @@ my $f_cat = (Krang::Category->find( url => $realcat.$splitcat.'/' ))[0]; unless ($f_cat) { my $parent_cat = (Krang::Category->find( url => $realcat ))[0]; + + # return with message if a category that doesnt match a site appears in the root of archive + if (not $parent_cat) { + add_message("bad_category", url => $realcat.$splitcat.'/'); + $not_found = 1; + last; + } my $new_cat = Krang::Category->new( dir => $splitcat, parent_id => $parent_cat->category_id ); $new_cat->save; |