View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0008683 | mantisbt | api soap | public | 2007-12-20 04:22 | 2008-01-19 04:24 |
Reporter | rombert | Assigned To | vboctor | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.1.0 | ||||
Target Version | 1.1.1 | Fixed in Version | 1.1.1 | ||
Summary | 0008683: mc_projects_get_user_accessible raises SYSTEM NOTICE, but it should not | ||||
Description | Other SOAP methods work fine ( mc_get_version and mc_project_get_users tested ). Error config is default:
| ||||
Additional Information | Request: <soapenv:Envelope> Response: <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> | ||||
Tags | patch | ||||
Attached Files | 8683.patch (2,594 bytes)
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; } | ||||
I haven't confirmed the issue, but I've targetted this issue to 1.1.1. |
|
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() |
|
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 ) { FROM : $t_subproject['subprojects'] = mci_user_get_accessible_subprojects( $p_user_id, $t_subproject_id); FILE : mc_project_api.php FROM : $t_project['subprojects'] = mci_user_get_accessible_subprojects( $t_user_id, $t_project_id ); |
|
Attached is my recommended patch, please verify it and let me know if it works fine now. |
|
mc_projects_get_user_accessible works fine with applied patch. Thank you |
|
Resolved in Mantis 1.1.1 using svn: 4874 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. |
|
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. |
|
Fixed in Mantis 1.1.1 using svn: 4900 |
|