View Issue Details

IDProjectCategoryView StatusLast Update
0012187mantisbtplug-inspublic2014-09-23 18:05
ReporterEisbaer Assigned Todregad  
PrioritynormalSeveritycrashReproducibilityhave not tried
Status closedResolutionfixed 
OSRedhat Linux 
Product Version1.2.1 
Target Version1.2.12Fixed in Version1.2.12 
Summary0012187: XML Import does not work
Description

I try to import issues with the Mantis ImportExport Plugin "Import/Export Einträge 1.0".

I get the following error Message in the webserver log:

PHP Fatal error: Class 'Mapper' not found in /var/www/html/mantis/plugins/XmlImportExport/ImportXml/Issue.php on line 131, referer: http://lxpts/mantis/plugin.php?page=XmlImportExport/import

I suppose the the problem is with my php version, thought it was checked o.k. during mantis installation on Redhat Linux.

I am using PHP 5.1.6 (cli) (built: Feb 26 2009 07:01:12)

It seems to me that the problem is in file Issue.php in line 131:

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

I think it should be "ImportXml_Mapper" instead of "Mapper", as in file Mapper.php the class is named "ImportXml_Mapper" (I did not try it out).

I'm not a php programmer, so this is just a gess.

As ist does work on my lokal windows installation, it think it could be a problem with the php version as there is no other difference.

Steps To Reproduce

Import an xml file (priorily exported and with profile_id added).
You get "Importing file, please wait..." in the browser.
Web server log will show the message above.

Additional Information

I fixed it for me by commenting out line 97 in file ImportXml.php - thus the call to the above function.
This will skip cross referencing (with I do not need) and which does not work anyway...

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

Eisbaer

Eisbaer

2010-07-22 04:34

reporter   ~0026119

Sorry, the code snipped should be:

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

(I actually had renamed it for a test...)

jreese

jreese

2010-08-22 18:05

reporter   ~0026406

Assigning to Giallu for investigation.

deborah_vasconcelos

deborah_vasconcelos

2010-09-01 14:25

reporter   ~0026542

The same problem occurs in 1.2.2 version...

dregad

dregad

2012-09-18 08:49

developer   ~0032863

Although I was not able to reproduce the issue, the parameter's type in the method's definition should be changed to match the actual class name.

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036182

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 9ec6fdaf

2012-09-18 00:24

dregad


Details Diff
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 0012187
Affected Issues
0012187
mod - plugins/XmlImportExport/ImportXml/Interface.php Diff File
mod - plugins/XmlImportExport/ImportXml/Issue.php Diff File

MantisBT: master c0af31bd

2012-09-18 00:24

dregad


Details Diff
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 0012187

Conflicts:

plugins/XmlImportExport/ImportXml/Issue.php
Affected Issues
0012187
mod - plugins/XmlImportExport/ImportXml/Interface.php Diff File
mod - plugins/XmlImportExport/ImportXml/Issue.php Diff File