View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011100 | mantisbt | api soap | public | 2009-10-30 09:59 | 2010-02-22 14:34 |
Reporter | warden | Assigned To | rombert | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.1.7 | ||||
Target Version | 1.2.0 | Fixed in Version | 1.2.0 | ||
Summary | 0011100: SOAP API login fails with LDAP | ||||
Description | Updated description: <pre> When trying to use the mc_issue_add with: you'll get an error that ... category is not defined, status is not defined, bla bla bla... | ||||
Tags | No tags attached. | ||||
Attached Files | 0001-Issue-11100-Avoid-warnings-when-the-ldap-simulation-.patch (878 bytes)
From d78bb8fabb9c3fefe353bf5ae5855141b4eece94 Mon Sep 17 00:00:00 2001 From: Robert Munteanu <robert.munteanu@gmail.com> Date: Sat, 31 Oct 2009 00:06:10 +0200 Subject: [PATCH] Issue #11100: Avoid warnings when the ldap simulation files is not found --- core/ldap_api.php | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/core/ldap_api.php b/core/ldap_api.php index ec2f7ea..5d737e2 100644 --- a/core/ldap_api.php +++ b/core/ldap_api.php @@ -395,6 +395,10 @@ function ldap_simulation_get_user( $p_username ) { $t_filename = config_get( 'ldap_simulation_file_path' ); $t_lines = file( $t_filename ); + if ( $t_lines === false ) { + log_event( LOG_LDAP, "ldap_simulation_get_user: could not read simulation data from $t_filename." ); + return null; + } foreach ( $t_lines as $t_line ) { $t_line = trim( $t_line, " \t\r\n" ); -- 1.6.4.2 | ||||
Please try the the latest git snapshot from 1.2.x, as many fixes have been applied which will not be applied to 1.1 . |
|
Please check your mantis configuration........ as far as the issue is concerned... I will test it and let you know. thx. |
|
My notification emails are in plain old english. Which is quite nice otherwise I would've deleted the email notifying me of this bug. |
|
That's indeed quite weird, because notification of a comment added by myself come in english. Anyway, about using 1.2.x, can you point me to any place describing upgrade? |
|
Ok, found it, but... just to use install.php. Wow, in 1.2.x it's even worse: |
|
I get the feeling you're using 1.2.0rc2. This particular issue was fixed in http://git.mantisbt.org/?p=mantisbt.git;a=commit;h=112122eddea6ee18cfa36b636239abb580793d5e . If you don't want to wait for an rc3 release, I suggest either clone the repository ( git clone git://git.mantisbt.org/mantisbt.git ) and checkout the master-1.2.x branch ( git checkout master-1.2.x ) or download a snapshot from http://git.mantisbt.org/?p=mantisbt.git;a=shortlog;h=refs/heads/master-1.2.x ( latest right now is http://git.mantisbt.org/?p=mantisbt.git;a=snapshot;h=087445cee12680c263f67f3907cc839a8c0cbe6e;sf=tgz ). Up till now there have been quite a few changes since 1.2.0rc2: <pre>087445cee12680c263f67f3907cc839a8c0cbe6e Fixes 0011015: mc_issue_update erases 'Due date' field With at least one more expected fix for 0011081. |
|
Almost, but not there yet. |
|
@rombert, I'm wondering if we should consider back porting the applicable fixes + test cases to the 1.1.x branch. I typically wouldn't do that for normal features, but my feel is that this will allow more instances to use the robust a SOAP API which makes clients life easier and the experience much better. Eventually, we can release 1.1.9 with such fixes. On the other hand, I would classify this as lower priority compared to the focus on 1.2.x. |
|
As the 1.2 is in RC state, I would accept that, but... just make it work ;-) Another thing, mc_issue_add should provide a method to set project by name and not ID. |
|
@vboctor it should be possible to backport some of the fixes, I can't say for sure. Trying to cherry-pick some of them ended up messing things up. |
|
|
|
@warden: can you please try the attached patch? |
|
@rombert, I would prefer replacing: with: This is the style that we usually follow for checking for mixed return values with bool false as the error case. |
|
@vboctor - patch updated. Need to see if this actually does solve the error though. |
|
@warden : It might be that you're using a LDAP simulation file with a relative path. In that case the web interface is using the mantis root to access the file, while the SOAP API is based in mantis root/api/soap, which causes the error. If that is the case, I'll update the documentation to reflect this. |
|
I can confirm that this patch solves this issue. Thanks :) |
|
This is excellent to know. Just to be on the safe side, was the problem a relative path setting, as I tried to guess above? |
|
Erm.. well, in fact I don't really know. I mean,from your sentence it looks like I would be setting the simulation file path by hand, but I didn't. |
|
I understand. Apparently even though simulation is not set, the warning generated when trying to access the file caused the SOAP API to break. Thanks. |
|
@rombert, we should only attempt to access the file if the file name is not blank. if ( !is_blank( $t_filename ) ) { This will be more efficient and is how it was supposed to work. |
|
@vboctor: You're right, I've added a is_blank guard before reading the file. Thanks. |
|
MantisBT: master-1.2.x aa457a1a 2009-10-30 18:06 Details Diff |
Issue 0011100: Avoid warnings when the ldap simulation files is not found |
Affected Issues 0011100 |
|
mod - core/ldap_api.php | Diff File | ||
MantisBT: master 94f40e2b 2009-10-30 18:06 Details Diff |
Issue 0011100: Avoid warnings when the ldap simulation files is not found |
Affected Issues 0011100 |
|
mod - core/ldap_api.php | Diff File | ||
MantisBT: master-1.2.x c8666c4f 2009-11-01 18:02 Details Diff |
Issue 0011100: Don't read the ldap simulation file if it is not set |
Affected Issues 0011100 |
|
mod - core/ldap_api.php | Diff File | ||
MantisBT: master 60dcfcda 2009-11-01 18:02 Details Diff |
Issue 0011100: Don't read the ldap simulation file if it is not set |
Affected Issues 0011100 |
|
mod - core/ldap_api.php | Diff File | ||
MantisBT: master-1.2.x a4d98b0b 2009-11-02 02:53 Details Diff |
Fixes 0011100: SOAP API login fails with LDAP. -- the simulation code was called by production code. |
Affected Issues 0011100 |
|
mod - core/ldap_api.php | Diff File | ||
MantisBT: master 20f9c654 2009-11-02 02:53 Details Diff |
Fixes 0011100: SOAP API login fails with LDAP. -- the simulation code was called by production code. |
Affected Issues 0011100 |
|
mod - core/ldap_api.php | Diff File |