Anonymous Login
2016-09-28 19:59 EDT

View Issue Details Jump to Notes ] Wiki ]
IDProjectCategoryView StatusLast Update
0008683mantisbtapi soappublic2008-01-19 04:24
Reporterrombert 
Assigned Tovboctor 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
Product Version1.1.0 
Target Version1.1.1Fixed in Version1.1.1 
Summary0008683: mc_projects_get_user_accessible raises SYSTEM NOTICE, but it should not
DescriptionOther SOAP methods work fine ( mc_get_version and mc_project_get_users tested ).

Error config is default:

        $g_display_errors = array(
                E_WARNING => 'inline',
                E_NOTICE => 'none',
                E_USER_ERROR => 'halt',
                E_USER_WARNING => 'inline',
                E_USER_NOTICE => 'none'
        );
Additional InformationRequest:

<soapenv:Envelope>
 <soapenv:Body>
  <ns0:mc_projects_get_user_accessible>
   <username soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:string">username</username>
   <password soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:string">password</password>
  </ns0:mc_projects_get_user_accessible>
 </soapenv:Body>
</soapenv:Envelope

Response:

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
 <SOAP-ENV:Body>
  <SOAP-ENV:Fault>
   <faultcode xsi:type="xsd:string">Server</faultcode>
   <faultactor xsi:type="xsd:string"/>
   <faultstring xsi:type="xsd:string">
Error Type: SYSTEM NOTICE, Error Description: Undefined variable: t_lang
    </faultstring>
  <detail xsi:type="xsd:string"/>
 </SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Tagspatch
Attached Files
  • patch file icon 8683.patch (2,594 bytes) 2008-01-06 16:16 -
    diff --git a/api/soap/mc_api.php b/api/soap/mc_api.php
    index 7bc047b..08307cf 100644
    --- a/api/soap/mc_api.php
    +++ b/api/soap/mc_api.php
    @@ -224,7 +224,15 @@
     		return '@' . $p_val . '@';
     	}
     	
    -	function mci_user_get_accessible_subprojects( $p_user_id, $p_parent_project_id ) {
    +	# --------------------
    +	# Gets the sub-projects that are accessible to the specified user / project.
    +	function mci_user_get_accessible_subprojects( $p_user_id, $p_parent_project_id, $p_lang = null ) {
    +		if ( $p_lang === null ) {
    +			$t_lang = mci_get_user_lang( $p_user_id );
    +		} else {
    +			$t_lang = $p_lang;
    +		}
    +
     		$t_result = array();
     		foreach( user_get_accessible_subprojects( $p_user_id, $p_parent_project_id ) as $t_subproject_id ) {
     			$t_subproject_row = project_cache_row( $t_subproject_id );
    @@ -239,9 +247,10 @@
     				array_key_exists( 'file_path', $t_subproject_row ) ? $t_subproject_row['file_path'] : "";
     			$t_subproject['description'] =
     				array_key_exists( 'description', $t_subproject_row ) ? $t_subproject_row['description'] : "";
    -			$t_subproject['subprojects'] = mci_user_get_accessible_subprojects( $p_user_id, $t_subproject_id );
    +			$t_subproject['subprojects'] = mci_user_get_accessible_subprojects( $p_user_id, $t_subproject_id, $t_lang );
     			$t_result[] = $t_subproject;
     		}
    +
     		return $t_result;
     	}
     	
    diff --git a/api/soap/mc_project_api.php b/api/soap/mc_project_api.php
    index 1b42199..6546b1b 100644
    --- a/api/soap/mc_project_api.php
    +++ b/api/soap/mc_project_api.php
    @@ -89,7 +89,6 @@
     	 */
     	function mc_projects_get_user_accessible( $p_username, $p_password ) {
     		$t_user_id = mci_check_login( $p_username, $p_password );
    -		$t_lang = mci_get_user_lang( $t_user_id );
     		if ( $t_user_id === false ) {
     			return new soap_fault( 'Client', '', 'Access Denied' );
     		}
    @@ -98,6 +97,8 @@
     			return new soap_fault( 'Client', '', 'Access Denied' );
     		}
     
    +		$t_lang = mci_get_user_lang( $t_user_id );
    +
     		$t_result = array();
     		foreach( user_get_accessible_projects( $t_user_id ) as $t_project_id ) {
     			$t_project_row = project_cache_row( $t_project_id );
    @@ -112,9 +113,10 @@
     				array_key_exists( 'file_path', $t_project_row ) ? $t_project_row['file_path'] : "";
     			$t_project['description'] =
     				array_key_exists( 'description', $t_project_row ) ? $t_project_row['description'] : "";
    -			$t_project['subprojects'] = mci_user_get_accessible_subprojects( $t_user_id, $t_project_id );
    +			$t_project['subprojects'] = mci_user_get_accessible_subprojects( $t_user_id, $t_project_id, $t_lang );
     			$t_result[] = $t_project;
     		}
    +
     		return $t_result;
     	}
     
    
    patch file icon 8683.patch (2,594 bytes) 2008-01-06 16:16 +

-Relationships
+Relationships

-Notes
vboctor

~0016482

vboctor (manager)

I haven't confirmed the issue, but I've targetted this issue to 1.1.1.
ccook

~0016520

ccook (reporter)

I have experienced the same issue using .NET

Error Type: SYSTEM WARNING, Error Description: Missing argument 1 for mc_projects_get_user_accessible()

Exception Details: System.Web.Services.Protocols.SoapException: Error Type: SYSTEM WARNING, Error Description: Missing argument 1 for mc_projects_get_user_accessible()
ccook

~0016521

ccook (reporter)

It looks like its just a missing parameter,

THE FIX:

FILE : mc_api.php

FROM : function mci_user_get_accessible_subprojects ( $p_user_id, $p_parent_project_id ) {
TO: function mci_user_get_accessible_subprojects ( $p_user_id, $p_parent_project_id, $t_lang ) {

FROM : $t_subproject['subprojects'] = mci_user_get_accessible_subprojects( $p_user_id, $t_subproject_id);
TO : $t_subproject['subprojects'] = mci_user_get_accessible_subprojects( $p_user_id, $t_subproject_id, $t_lang );



FILE : mc_project_api.php
IN: function mc_projects_get_user_accessible

FROM : $t_project['subprojects'] = mci_user_get_accessible_subprojects( $t_user_id, $t_project_id );
TO : $t_project['subprojects'] = mci_user_get_accessible_subprojects( $t_user_id, $t_project_id, $t_lang );
vboctor

~0016566

vboctor (manager)

Attached is my recommended patch, please verify it and let me know if it works fine now.
rombert

~0016613

rombert (developer)

mc_projects_get_user_accessible works fine with applied patch.

Thank you
vboctor

~0016615

vboctor (manager)

Resolved in Mantis 1.1.1 using svn: 4874
Resolved in Mantis 1.2.x using svn: 4873

Given that I have merged back the changes to 1.1 and this required some code changes, would be great if we can test this using the latest files in the 1.1.1 changeset.
planser

~0016619

planser (reporter)

I think the change introduced a new error in mc_api.php#mci_category_get_all_rows(). mantis_category_table does not yet exist in 1.1.x.
vboctor

~0016690

vboctor (manager)

Fixed in Mantis 1.1.1 using svn: 4900
Fixed in Mantis 1.2.x using svn: 4901
+Notes

-Issue History
Date Modified Username Field Change
2007-12-20 04:22 rombert New Issue
2007-12-20 12:14 vboctor Note Added: 0016482
2007-12-20 12:14 vboctor Status new => acknowledged
2007-12-20 12:14 vboctor Target Version => 1.1.1
2007-12-20 12:14 vboctor Additional Information Updated
2007-12-29 13:23 ccook Note Added: 0016520
2007-12-29 14:30 ccook Note Added: 0016521
2007-12-29 18:22 vboctor Tag Attached: patch
2008-01-06 16:13 vboctor Status acknowledged => assigned
2008-01-06 16:13 vboctor Assigned To => vboctor
2008-01-06 16:14 vboctor File Added: 8683.patch
2008-01-06 16:14 vboctor Note Added: 0016566
2008-01-06 16:16 vboctor File Deleted: 8683.patch
2008-01-06 16:16 vboctor File Added: 8683.patch
2008-01-10 05:10 rombert Note Added: 0016613
2008-01-10 06:04 vboctor Status assigned => resolved
2008-01-10 06:04 vboctor Fixed in Version => 1.1.1
2008-01-10 06:04 vboctor Resolution open => fixed
2008-01-10 06:04 vboctor Note Added: 0016615
2008-01-10 07:50 planser Note Added: 0016619
2008-01-10 11:05 vboctor Status resolved => assigned
2008-01-10 11:05 vboctor Resolution fixed => open
2008-01-10 11:05 vboctor Fixed in Version 1.1.1 =>
2008-01-17 03:01 vboctor Status assigned => resolved
2008-01-17 03:01 vboctor Fixed in Version => 1.1.1
2008-01-17 03:01 vboctor Resolution open => fixed
2008-01-17 03:01 vboctor Note Added: 0016690
2008-01-19 04:24 vboctor Status resolved => closed
+Issue History