View Issue Details

IDProjectCategoryView StatusLast Update
0014916Mylyn ConnectorBuildpublic2017-02-14 15:30
Reporterrombert Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version3.8.0 
Target VersionBacklog 
Summary0014916: Synchronization error due to deleted user in Mantis
Description

A user (let's call it "UserX") had been deleted in Mantis.
When I try to sync mantis issues which refers to UserX (as reporter and bug note author) mylyn logs the following error :

java.lang.IllegalArgumentException: Null name for MantisUser with id 17

Additional details below

I tried to modity mc_account_api.php in Mantis to handle deleted users (see attachment) but the problem remains.

Additional Information

Complete error stack trace :

java.lang.IllegalArgumentException: Null name for MantisUser with id 17
at com.itsolut.mantis.core.model.MantisTicketAttribute.<init>(MantisTicketAttribute.java:27)
at com.itsolut.mantis.core.model.MantisUser.<init>(MantisUser.java:24)
at com.itsolut.mantis.core.soap.MantisConverter.convert(MantisConverter.java:153)
at com.itsolut.mantis.core.soap.MantisSoapClient.registerAdditionalReporters(MantisSoapClient.java:150)
at com.itsolut.mantis.core.soap.MantisSoapClient.getTicket(MantisSoapClient.java:137)
at com.itsolut.mantis.core.MantisTaskDataHandler.getTaskData(MantisTaskDataHandler.java:256)
at com.itsolut.mantis.core.MantisRepositoryConnector.getTaskData(MantisRepositoryConnector.java:282)
at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeTasksJob.synchronizeTask(SynchronizeTasksJob.java:245)
at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeTasksJob.runInternal(SynchronizeTasksJob.java:218)
at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeTasksJob.run(SynchronizeTasksJob.java:153)
at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeTasksJob.run(SynchronizeTasksJob.java:129)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

TagsNo tags attached.
Attached Files

Activities

rombert

rombert

2012-11-04 11:29

manager   ~0033442

Interesting, let's see if there is something which can be done in the Eclipse client . Otherwise we'll send this to the mantisbt.org bugtracker

rombert

rombert

2012-11-04 11:29

manager   ~0033443

Original note author: jeckyhl

I found why my first correction in Mantis SOAP API didn't worked (see attachment mc_account_api (v2).php.patch). The trick is to return a fake username like 'userXX' where XX is the id of the deleted user (this is done by method user_get_name in user_api.php).

Yet I'm not sure this is the right way to fix this issue.

rombert

rombert

2012-11-04 11:29

manager   ~0033444

Last edited: 2012-11-04 12:09

Originally reported at https://sourceforge.net/apps/mantisbt/mylyn-mantis/view.php?id=259 by jeckyhl

mc_account_api.php.patch (472 bytes)   
Index: mc_account_api.php
===================================================================
--- mc_account_api.php	(r�vision 851)
+++ mc_account_api.php	(copie de travail)
@@ -11,7 +11,7 @@
 	$t_result['id'] = $p_user_id;
 
 	if( user_exists( $p_user_id ) ) {
-		$t_result['name'] = user_get_field( $p_user_id, 'username' );
+		$t_result['name'] = user_get_name( $p_user_id );
 		$t_dummy = user_get_field( $p_user_id, 'realname' );
 
 		if( !empty( $t_dummy ) ) {
mc_account_api.php.patch (472 bytes)   
mc_account_api (v2).php.patch (554 bytes)   
Index: mc_account_api.php
===================================================================
--- mc_account_api.php	(r�vision 851)
+++ mc_account_api.php	(copie de travail)
@@ -9,9 +9,10 @@
 function mci_account_get_array_by_id( $p_user_id ) {
 	$t_result = array();
 	$t_result['id'] = $p_user_id;
-
+	$t_result['name'] = user_get_name( $p_user_id );
+	
 	if( user_exists( $p_user_id ) ) {
-		$t_result['name'] = user_get_field( $p_user_id, 'username' );
+		
 		$t_dummy = user_get_field( $p_user_id, 'realname' );
 
 		if( !empty( $t_dummy ) ) {