View Issue Details

IDProjectCategoryView StatusLast Update
0011029mantisbtplug-inspublic2014-09-23 18:05
Reportermbellino Assigned Togiallu  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0rc2 
Target Version1.2.12Fixed in Version1.2.12 
Summary0011029: XML Import (and export) plugin do not work
Description

When I try to imort an XML file, I get the following error onto the server :

[Mon Oct 12 15:33:59 2009] [error] [client xx.xx.xx.xx] PHP Fatal error: Class 'XMLReader' not found in /var/www/html/mantisbt-1.2.0rc2/plugins/XmlImportExport/ImportXml.php on line 59, referer: http://xx.xx.xx.xx/mantisbt-1.2.0rc2/plugin.php?page=XmlImportExport/import

Similar errors appears when i would like to export to XML :

[Mon Oct 12 15:01:34 2009] [error] [client xx.xx.xx.xx] PHP Fatal error: Class 'XMLWriter' not found in /var/www/html/mantisbt-1.2.0rc2/plugins/XmlImportExport/pages/export.php on line 56, referer: http://xx.xx.xx.xx/mantisbt-1.2.0rc2/view_all_bug_page.php

Additional Information

This is a completely new install of 1.2.0rc2.

Is there a place where to find an example of XML file to import?

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0014000 closeddregad HTTP 404 error on clicking the "XML Export" link 
has duplicate 0012839 closeddregad MantisBT XmlImportExport/export gives File Not Found 

Activities

giallu

giallu

2009-10-12 16:44

reporter   ~0023154

assuming you are running linux you need to install the php-xml package or otherwise activate xml support in you php

vboctor

vboctor

2009-10-12 23:55

manager   ~0023160

It would be useful to detect that required dependencies are not available and provide the user with a friendly message. From memory we do this in scenarios like Twitter integration when curl extension is not available.

mbellino

mbellino

2009-10-13 04:36

reporter   ~0023164

Last edited: 2009-10-13 05:44

You are right, I am running with Linux (Fedora).

As proposed, I installed "php-xml", and this solves my issue. (do not forget to restart httpd).

But I am still unable to imoprt any XML files. I suppose this is due to the XML structure needed.
I tried to follow the procedure of the (old?) Import/export plugins http://bugtracker.morinie.fr/mantis/dokuwiki/doku.php?id=mantis:13:importing_issue_s#importing_issue_s :

<?xml version="1.0" encoding="utf-8" ?>
<mantis>
<author>administrator</author>
<date>2007-06-01 09:09</date>
<bugs>
<bug>
<additional_information></additional_information>
<date_submitted>29/05/2005</date_submitted>
<custom name="Date">18/06/2007</custom>
<custom name="Custom Field 2">Test chaine</custom>
<bugnotes>
<bugnote>
<id>0</id>
<reporter_id>1</reporter_id>
<note>Feedback 1</note>
<view_state>10</view_state>
<date_submitted>01/01/2007</date_submitted>
<last_modified>01/01/2007</last_modified>
</bugnote>
</bugnotes>
<project_id>1</project_id>
<category>Category 1</category>
<reporter_id>1</reporter_id>
<status>50</status>
<summary>Test reminder with deadline empty</summary>
<description>Test</description>
</bug>
</bugs>
</mantis>

I also tried some modified version of the XML export file, but without any success. Is there a procedure, or examples ? (google seems not to be my friend onto this topic)

vboctor

vboctor

2009-10-17 12:52

manager   ~0023229

@giallu, do we have some documentation on the import/export XML plugin?

rolfab

rolfab

2009-10-19 18:08

reporter   ~0023249

Last edited: 2009-10-19 18:09

Same situation here. Any documentation on XML import would be much appreciated.

Wether doc is available or not (a) sample of "working" XML file(s) would be very helpful as a starting point. An example of XML for custom fields would be great.

sebdelyon

sebdelyon

2009-11-03 09:24

reporter   ~0023555

Last edited: 2009-11-03 10:06

a sample of working XML file could be obtained by exporting issues via XmlImportExport plugin.
All fields can't be provided but the essentiels work well.

here a sample of working XML file :
<?xml version="1.0" encoding="utf-8" ?>
<Mantis>
<issue>
<project/>
<reporter id="">Carole XXX</reporter>
<priority id="30">normale</priority>
<severity id="20">simple</severity>
<reproducibility id="100">S/O</reproducibility>
<status id="80">résolu</status>
<resolution id="20">résolu</resolution>
<projection id="10">aucun</projection>
<category id="7">Evolution</category>
<date_submitted>944524800</date_submitted>
<last_updated>1257263236</last_updated>
<eta id="10">aucun</eta>
<os_build/>
<version/>
<fixed_in_version/>
<view_state id="10">public</view_state>
<profile_id/>
<summary>Requête SQL</summary>
<due_date/>
<description>Générer fichier excel </description>
<additional_information>Identifiant Zéphyr : 1</additional_information>
</issue>
</Mantis>

squarebox

squarebox

2009-11-09 21:43

reporter   ~0023630

Last edited: 2009-11-09 22:09

I had a vanilla install and applied some of the patches available for resolved issues in 1.2.0rc2.

using the above xml i still received the following error

Database query failed. Error received from database was 0001366: Incorrect integer value: '

' for column 'profile_id' at row 1 for the query: INSERT INTO mantis_bug_table
( project_id,reporter_id, handler_id,duplicate_id,
priority,severity, reproducibility,status,
resolution,projection, category_id,date_submitted,
last_updated,eta, bug_text_id,
os, os_build,platform, version,build,
profile_id, summary, view_state, sponsorship_total, sticky, fixed_in_version,
target_version, due_date
)

          VALUES
            ( ?,?,?,?,
              ?,?,?,?,
              ?,?,?,?,
              ?,?,?,?,
              ?,?,?,?,
              ?,?,?,?,
              ?,?,?,?).

i then edited the xml to have a value for profile_id as

<profile_id>0</profile_id>

and then i get

500 -内部サーバー エラーです。
検索中のリソースに問題が発生したため、表示することができません。

edit: sorry i'm running a japanese localized version...
error is
500- internal server error
There was a problem while searching for a resource, and can:t be displayed.

cor3huis

cor3huis

2009-12-09 08:56

reporter   ~0023885

Last edited: 2009-12-09 09:38

Same ERROR here, exported XML first, then tried to import this. No luck.

A like to update documentation, but there is no "official" starting point for "import" that I could find. Only http://www.mantisbt.org/wiki/doku.php/mantisbt:importexport

Being persistent I searche on and on, and found some links. Maybe this helps
http://bugtracker.morinie.fr/mantis/dokuwiki/doku.php?id=mantis:13:importing_issue_s

and this

http://bugtracker.morinie.fr/mantis/dokuwiki/doku.php?id=mantis:13:xml_format_and_mantis

I got some success but import does not(yet) show up.

Importing file, please wait... Done
Processing cross-references for 0 issues... Done

Well, looking into the source now.

Mantis Import/Export is a plug-in, File this defect in http://bugtracker.morinie.fr/ is probably better. But since it is included into the default 1.2.0RC package, thing get unclear.

ntermaris

ntermaris

2009-12-09 11:05

reporter   ~0023886

Can xml export work with greek encoding??? like
αυτο είναι ένα τεστ
thanks
Alex

ntermaris

ntermaris

2009-12-09 11:08

reporter   ~0023887

Can xml export work with greek encoding??? like
αυτο είναι ένα τεστ
thanks
Alex

cor3huis

cor3huis

2009-12-09 12:01

reporter   ~0023888

Questions are better asked on forum, this is a defect tracker. But yes, I see no reason export cannot handle a character set e.g. UTF-8 already used in your instance of the defect tracker webapp.

dregad

dregad

2010-10-01 05:00

developer   ~0026925

For those like me who have trouble finding the linux package for SUSE, it is called php5-xmlwriter.

dregad

dregad

2012-09-18 08:28

developer   ~0032861

As suggested by vboctor in 0011029:0023160, added a check in plugin's install() method to display an error message in case XMLReader class is not available

atrol

atrol

2012-09-24 17:04

developer   ~0032926

The constant ERROR_PLUGIN_INSTALL_FAILED is not defined in master-1.2.x

dregad

dregad

2012-09-24 18:20

developer   ~0032927

Thanks Roland, sorry about that... I tested in master and omitted to do the same in 1.2.x.

I backported one additional commit from giallu which defines the constant and related error message; that should do the trick.

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036197

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x 7d36bd8b

2009-12-18 11:01

giallu


Details Diff
Add plugins installation error code and message

Backport from master 1ca21993bd3dfcbdaf63c229f1f85a2790802fb9

Fixes 0011029
Affected Issues
0011029
mod - core/constant_inc.php Diff File
mod - lang/strings_english.txt Diff File

MantisBT: master-1.2.x 7a6ee16a

2009-12-18 11:14

giallu


Details Diff
Fail installation if xmlreader and xmlwriter extensions are not present

Back-ported from master 70a2d239649423c25cc8b62a83d7c7274d33a467

Fixes 0011029
Affected Issues
0011029
mod - plugins/XmlImportExport/XmlImportExport.php Diff File
mod - plugins/XmlImportExport/lang/strings_english.txt Diff File

MantisBT: master 1ca21993

2009-12-18 19:01

giallu


Details Diff
Add plugins installation error code and message Affected Issues
0011029
mod - core/constant_inc.php Diff File
mod - lang/strings_english.txt Diff File

MantisBT: master 736ce666

2009-12-18 19:14

giallu


Details Diff
Fail installation if xmlreader and xmlwriter extensions are not present Affected Issues
0011029
mod - plugins/XmlImportExport/XmlImportExport.php Diff File
mod - plugins/XmlImportExport/lang/strings_english.txt Diff File