Skip to content

Commit

Permalink
XmlImportExport: Allow import of inherited categories
Browse files Browse the repository at this point in the history
Fixes #11114
  • Loading branch information
dregad committed Sep 18, 2012
1 parent cb82535 commit f156fb1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugins/XmlImportExport/ImportXml/Issue.php
Expand Up @@ -74,9 +74,15 @@ public function process( XMLreader $reader ) {
$reader->read( );

if( $this->keepCategory_ ) {
$t_category_id = category_get_id_by_name( $reader->value, $t_project_id );
if( $t_category_id !== false ) {
$this->newbug_->category_id = $t_category_id;
# Check for the category's existence in the current project
# well as its parents (if any)
$t_projects_hierarchy = project_hierarchy_inheritance( $t_project_id );
foreach( $t_projects_hierarchy as $t_project ) {
$t_category_id = category_get_id_by_name( $reader->value, $t_project, false );
if( $t_category_id !== false ) {
$this->newbug_->category_id = $t_category_id;
break;
}
}
}

Expand Down

0 comments on commit f156fb1

Please sign in to comment.