6.0.0-beta1
7/4/25

[#12297] LDAP search failed - PHP errors
Summary LDAP search failed - PHP errors
Queue Turba
Queue Version 4.0.4
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester frank.richter (at) hrz (dot) tu-chemnitz (dot) de
Created 06/04/2013 (4413 days ago)
Due
Updated 06/04/2013 (4413 days ago)
Assigned
Resolved 06/04/2013 (4413 days ago)
Github Issue Link
Github Pull Request
Milestone 4.1.0
Patch No

History
06/04/2013 05:58:44 PM julien (dot) savoie (at) usainteanne (dot) ca Comment #5 Reply to this comment
Changing the operator === also fixes the issue on my side.  Thanks!
06/04/2013 09:39:23 AM Jan Schneider Assigned to Jan Schneider
State ⇒ Resolved
Milestone ⇒ 4.1.0
 
06/04/2013 09:37:31 AM Git Commit Comment #4 Reply to this comment
Changes have been made in Git (master):

commit 3fff7d240a325b4a8af0ffeccf1790a5730d7595
Author: Jan Schneider <jan@horde.org>
Date:   Tue Jun 4 11:28:03 2013 +0200

     Fix test (Bug #12297).

  turba/lib/Driver/Ldap.php |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/3fff7d240a325b4a8af0ffeccf1790a5730d7595
06/04/2013 09:28:37 AM Git Commit Comment #3 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_0):

commit 8c96ef0698de0e7f924ed470019175e76ff273c0
Author: Jan Schneider <jan@horde.org>
Date:   Tue Jun 4 11:28:03 2013 +0200

     Fix test (Bug #12297).

  turba/lib/Driver/Ldap.php |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/8c96ef0698de0e7f924ed470019175e76ff273c0
06/04/2013 09:22:41 AM Jan Schneider Comment #2 Reply to this comment
Debug information from the mailing list:

Backtrace:
1. Turba_Driver->search() /usr/share/horde5/turba/search.php:132
2. Turba_Driver_Ldap->_search() /usr/share/horde5/turba/lib/Driver.php:604
3. Turba_Driver_Ldap->_buildSearchQuery()
/usr/share/horde5/turba/lib/Driver/Ldap.php:165
4. Turba_Driver_Ldap->_buildSearchQuery()
/usr/share/horde5/turba/lib/Driver/Ldap.php:498
5. Horde::debug() /usr/share/horde5/turba/lib/Driver/Ldap.php:494

2013-06-03T22:17:12+00:00 DEBUG: Variable information:
array(1) {
   [0]=>
   array(5) {
     ["field"]=>
     string(2) "cn"
     ["op"]=>
     string(4) "LIKE"
     ["test"]=>
     string(7) "cynthia"
     ["begin"]=>
     bool(false)
     ["approximate"]=>
     bool(false)
   }
}

Backtrace:
1. Turba_Driver->search() /usr/share/horde5/turba/search.php:132
2. Turba_Driver_Ldap->_search() /usr/share/horde5/turba/lib/Driver.php:604
3. Turba_Driver_Ldap->_buildSearchQuery()
/usr/share/horde5/turba/lib/Driver/Ldap.php:165
4. Horde::debug() /usr/share/horde5/turba/lib/Driver/Ldap.php:494

2013-06-03T22:17:12+00:00 DEBUG: Variable information:
array(5) {
   ["field"]=>
   string(2) "cn"
   ["op"]=>
   string(4) "LIKE"
   ["test"]=>
   string(7) "cynthia"
   ["begin"]=>
   bool(false)
   ["approximate"]=>
   bool(false)
}

Once again:
2013-06-03T22:17:12+00:00 WARN: HORDE [turba] PHP ERROR: Invalid argument
supplied for foreach() [pid 16742 on line 506 of
"/usr/share/horde5/turba/lib/Driver/Ldap.php"]
06/04/2013 07:27:42 AM frank (dot) richter (at) hrz (dot) tu-chemnitz (dot) de Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ LDAP search failed - PHP errors
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
After upgrading to Turba 4.0.4 I get many lines in horde.log:
2013-06-04T08:11:58+02:00 WARN: HORDE [turba] PHP ERROR: Invalid 
argument supplied for foreach() [pid 30089 on line 495 of 
"/var/www/html/horde/turba/lib/Driver/Ldap.php"]
2013-06-04T08:11:58+02:00 WARN: HORDE [turba] PHP ERROR: Invalid 
argument supplied for foreach() [pid 30089 on line 505 of 
"/var/www/html/horde/turba/lib/Driver/Ldap.php"]

I traced it down to
/var/www/html/horde/turba/lib/Driver/Ldap.php:496
if (!empty($vals['OR']) || $key == 'OR') {

When $key is 0 (zero) the condition $key == 'OR' is true - strange IMHO!
I changed to $key === 'OR' - and everything is fine.

Regards,
Frank


Saved Queries