Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9b39286bbcba
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 33c9c01988af
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 18, 2012

  1. XmlImportExport: Reference correct class name

    The parameter of update_map() was defined as being of Class "Mapper",
    but the actual class name is "ImportXml_Mapper"
    
    Fixes #12187
    
    Conflicts:
    
    	plugins/XmlImportExport/ImportXml/Issue.php
    dregad committed Sep 18, 2012
    Copy the full SHA
    c0af31b View commit details
  2. XmlImportExport: Allow import of inherited categories

    Fixes #11114
    dregad committed Sep 18, 2012
    Copy the full SHA
    b7acce2 View commit details
  3. XmlImportExport: removed obsolete comment

    Since 1.1 is no longer supported, I guess we won't ever backport this...
    dregad committed Sep 18, 2012
    Copy the full SHA
    33c9c01 View commit details
Showing with 12 additions and 8 deletions.
  1. +2 −2 plugins/XmlImportExport/ImportXml/Interface.php
  2. +10 −6 plugins/XmlImportExport/ImportXml/Issue.php
4 changes: 2 additions & 2 deletions plugins/XmlImportExport/ImportXml/Interface.php
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ interface ImportXml_Interface {
*
* @param XMLreader $reader
*/
public function process( XMLreader$reader );
public function process( XMLreader $reader );

/**
* Update the old_id => new_id conversion map
@@ -34,5 +34,5 @@ public function process( XMLreader$reader );
*
* @param Mapper $mapper
*/
public function update_map( Mapper$mapper );
public function update_map( ImportXml_Mapper $mapper );
}
16 changes: 10 additions & 6 deletions plugins/XmlImportExport/ImportXml/Issue.php
Original file line number Diff line number Diff line change
@@ -68,15 +68,19 @@ public function process( XMLreader $reader ) {
case 'category':
$this->newbug_->category_id = $this->defaultCategory_;

// TODO: if we port the import/export code to 1.1.x, this needs to be
// improved to cope with the different cases (1.1 => 1.2, 1.2 => 1.1 etc)
if( version_compare( MANTIS_VERSION, '1.2', '>' ) === true ) {
$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;
}
}
}

@@ -241,7 +245,7 @@ public function process( XMLreader $reader ) {
//echo "\nnew bug: $this->new_id_\n";
}

public function update_map( Mapper $mapper ) {
public function update_map( ImportXml_Mapper $mapper ) {
$mapper->add( 'issue', $this->old_id_, $this->new_id_ );
}