-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Ldap] Bypass the use of ldap_control_paged_result
on PHP >= 7.3
#38392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Side note: to test the component I've created an OpenLDAP instance on docker using latest osixia/openldap. TO make test working, I had to add Even with this configuration, some test fails with message It would be a good idea to have a docker environment prepared to test those methods....at least in order to have a common environment. |
ldap_control_paged_result
if PHP version is 8.0 o…ldap_control_paged_result
on PHP >= 7.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add types (arguments+return) on methods when possible.
I agree. We run such tests in |
2458d2a
to
d332b30
Compare
Thank you @lucasaba. |
Thanks to you all! Has been a pleasure and a precious lesson! |
After PR symfony#38392 there is a little issue in the Symfony code base that occurs only for PHP 7.4 and PHP 8.0. This is related to issue symfony#38874
After PR symfony#38392 there is a little issue in the Symfony code base that occurs only for PHP 7.4 and PHP 8.0. This is related to issue symfony#38874
After PR symfony#38392 there is a little issue in the Symfony code base that occurs only for PHP 7.4 and PHP 8.0. This is related to issue symfony#38874
After PR symfony#38392 there is a little issue in the Symfony code base that occurs only for PHP 7.4 and PHP 8.0. This is related to issue symfony#38874
This PR was merged into the 4.4 branch. Discussion ---------- [Ldap] Fix pagination | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #38874 | License | MIT | Doc PR | N/A This replaces #38875 to fix a bug introduced by #38392 Commits ------- 4fe0a6f Fix LDAP pagination
This PR was merged into the 4.4 branch. Discussion ---------- Fix critical extension when reseting paged control | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - The issue has been introduced here in #38392 and prevent performing an operation after fetched a paginated result => ldap throws an `Could not XXX: Critical extension is unavailable` At this line: https://github.com/symfony/symfony/pull/38392/files#diff-24b79f3ac1a99938f5acb158a450e38d30c1984a5d333b5b20f2c38a73d10e31L183, the previous code called `ldap_control_paged_result($con, 0);` using the default value (`false`) for the `$critical` argument. The replaced version always use `true`. This PR restore the previous behavior by using `false` when reseting the pagination. Commits ------- a2b7476 Fix critical extension when reseting paged control
As stated on #38352 ldap_control_paged_result and ldap_control_paged_result_response have been deprecated since PHP 7.4 and will be removed on PHP 8.0.
With this fix, Query uses serverctrls to handle LDAP results pagination.
Since
serverctrls
where introduced in PHP 7.3 and they are the only way to circumvent the usage ofldap_control_paged_result
, I've added a new Query class implementation which usesserverctrls
to control pagination.To do so I've also had to update the LDAP Adapter in order to use the new class if PHP version 7.3 or greater are found