Permalink
Browse files

XML import: fix system notices

  • Loading branch information...
1 parent 8daa53f commit 3847a65b06ae4fbda98597664a9f65eaf0d11140 @dregad dregad committed Oct 25, 2013
Showing with 12 additions and 4 deletions.
  1. +1 −0 plugins/XmlImportExport/ImportXml.php
  2. +11 −4 plugins/XmlImportExport/ImportXml/Issue.php
@@ -171,6 +171,7 @@ public function import( ) {
printf( "Processing cross-references for %s issues...", count( $importedIssues ) );
foreach( $importedIssues as $oldId => $newId ) {
$bugData = bug_get( $newId, true );
+ $content_replaced = false;
$bugLinkRegexp = '/(^|[^\w])(' . preg_quote( $this->source_->issuelink, '/' ) . ')(\d+)\b/e';
// replace links in description
@@ -71,6 +71,10 @@ public function process( XMLreader $reader ) {
$t_project_id = helper_get_current_project(); // TODO: category_get_id_by_name could work by default on current project
$userId = auth_get_current_user_id( );
+ $t_custom_fields = array();
+ $t_bugnotes = array();
+ $t_attachments = array();
+
$depth = $reader->depth;
while( $reader->read() &&
($reader->depth > $depth ||
@@ -259,10 +263,13 @@ public function process( XMLreader $reader ) {
// Create a temporary file in the temporary files directory using sys_get_temp_dir()
$temp_file_name = tempnam( sys_get_temp_dir(), 'MantisImport' );
file_put_contents( $temp_file_name, base64_decode( $t_attachment->content ) );
- $file_data = array( 'name' => $t_attachment->filename,
- 'type' => $t_attachment->file_type,
- 'tmp_name' => $temp_file_name,
- 'size' => filesize( $temp_file_name ) );
+ $file_data = array(
+ 'name' => $t_attachment->filename,
+ 'type' => $t_attachment->file_type,
+ 'tmp_name' => $temp_file_name,
+ 'size' => filesize( $temp_file_name ),
+ 'error' => UPLOAD_ERR_OK,
+ );
// unfortunately we have no clue who has added the attachment (this could only be fetched from history -> feel free to implement this)
// also I have no clue where description should come from...
file_add( $this->new_id_, $file_data, 'bug', $t_attachment->title, $p_desc = '', $p_user_id = null, $t_attachment->date_added, true );

0 comments on commit 3847a65

Please sign in to comment.