• polylang-1.6.5

    I got some errors when using with my plugin Polylang – Translate URL Rewrite Slugs but I’m sure it could help for others circumstances.

    I had an additional “isset” to the function parse_query of the file frontend/frontend.php.

    The patch

    diff --git a/frontend/frontend.php b/frontend/frontend.php
    index 61bd775..84c5bd3 100644
    --- a/frontend/frontend.php
    +++ b/frontend/frontend.php
    @@ -103,7 +103,9 @@ class PLL_Frontend extends PLL_Base {
     				$query->set('post_type', 'post');
    
     			// do we query another custom taxonomy?
    -			$taxonomies = array_diff(wp_list_pluck($query->tax_query->queries, 'taxonomy'), array('language', 'category', 'post_tag'));
    +			$taxonomies = array();
    +			if (isset($query->tax_query->queries))
    +				$taxonomies = array_diff(wp_list_pluck($query->tax_query->queries, 'taxonomy'), array('language', 'category', 'post_tag'));
    
     			// unset the is_archive flag for language pages to prevent loading the archive template
     			// keep archive flag for comment feed otherwise the language filter does not work

    Thanks!

    https://wordpress.org/plugins/polylang/

Viewing 1 replies (of 1 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    Thanks for your patch. I uploaded a developement version (1.6.5.1) which replaces the faulty code by another one. But I guess that it would raise the same kind of warning so I will have to fix it again, though I don’t understand how $query->tax_query->queries can be empty when the language taxonomy is queried.

Viewing 1 replies (of 1 total)
  • The topic ‘Patch for fixing notices and warnings’ is closed to new replies.