Closed (fixed)
Project:
Lightweight Directory Access Protocol
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2014 at 16:00 UTC
Updated:
5 Apr 2017 at 16:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bradezone commentedOkay, after looking at this, when I debug the $result array, my "count" parameter is the last element of the array. Therefore if I use "array_pop" instead of "array_shift" it works -- is there a way to force the count to be the first element, or is this somehow set by the LDAP server itself?
Comment #2
bradezone commentedActually when I deployed this on a server, the "count" WAS the first array element. So a better fix is as follows. It might be easier for you to add this fix to the repo, since it's pretty tiny:
Comment #3
haydeniv commentedI haven't tested this at all but do we even want count in the entries? Maybe:
would be better. I'm not sure because I don't use ldap_views. Regardless here is a patch with your suggestion in #2
Comment #4
kenorb commentedComment #5
johnbarclay commentedComment #6
zxaos commentedThe good news is that #3 resolves the issue.
The even better news is that #3 also resolves an issue where ldap views could not filter properly ( related to https://www.drupal.org/node/2216843 ? )
Comment #7
zxaos commentedOn further testing, there's some additional places where the same assumption is made that count is at a particular array position.
Here's an updated patch that includes the previous changes as well as trying to make other references to count array-position agnostic.
Comment #8
grahlComment #9
grahlComment #10
grahlAnyone else using this patch successfully?
Comment #11
catapipperSeems to be working fine for me.
Comment #13
grahlThank you for the patch and feedback, committed.
What I can't tell from that patch is whether there ever could be a case where $result if not exactly false but does not contain count. I'm presuming this isn't an issue based on the feedback. Even if it where, not relying in the cryptic array shifting is clearly a far superior solution and should be used instead of it.