Skip to content
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

Deprecated Class Property search_url used with Polylang #5967

Closed
stephaniecot opened this issue Jun 7, 2023 · 1 comment · Fixed by #6081
Closed

Deprecated Class Property search_url used with Polylang #5967

stephaniecot opened this issue Jun 7, 2023 · 1 comment · Fixed by #6081
Assignees
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting effort: [XS] < 1 day of estimated development time priority: medium Issues which are important, but no one will go out of business. type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Milestone

Comments

@stephaniecot
Copy link

Describe the bug
Since the most recent update of Polylang, the use of WP Rocket to clear the cache for all language throws a deprecated error from the get_rocket_i18n_uri() function. It uses the search_url property that is now deprecated. get_search_url() should be used instead.

To Reproduce
Steps to reproduce the behavior:

  1. Clear the cache for all languages
  2. The error should appear in de debug.log
@piotrbak piotrbak added type: enhancement Improvements that slightly enhance existing functionality and are fast to implement 3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting priority: medium Issues which are important, but no one will go out of business. needs: testing labels Jul 24, 2023
@Tabrisrp
Copy link
Contributor

Reproduce the issue ✅

Reproduced the issue on my local install

Identify the root cause ✅

Accessing the class property directly is deprecated since version 3.4, because the property is now private. getter method has been added instead.

Scope a solution ✅

We can resolve the issue by using the following:

$languages = $pll->model->get_languages_list();

			foreach ( $languages as $language ) {
				$urls[] = $language->get_home_url();
			}

but this is valid only starting from 3.4, because the getter method didn't exist before. So we will also need to add a conditional to use the previous code for the earlier versions, and the new one for 3.4 and higher.

Estimate the effort ✅

Effort XS

@Tabrisrp Tabrisrp added effort: [XS] < 1 day of estimated development time and removed needs: testing labels Jul 31, 2023
@mostafa-hisham mostafa-hisham self-assigned this Aug 2, 2023
@piotrbak piotrbak added this to the 3.14.4 milestone Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting effort: [XS] < 1 day of estimated development time priority: medium Issues which are important, but no one will go out of business. type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants