• Plugin Author Chouby

    (@chouby)


    Some users are having issues with Polylang 1.2.x as for example it breaks the Avada theme. Since the database has been modified between 1.1.6 and 1.2, it is not as easy as usual to revert to the previous version.

    For people who have not made a database backup before the upgrade and who need to revert to 1.1.6, a plugin is available on pastebin: https://pastebin.com/0TdQzQLv

    Please follow carefully the instructions and do not orget the database backup.

    You can ask questions on this procedure on this thread. Please open a separate thread for Polylang 1.2.x bug reports.

    https://www.ads-software.com/plugins/polylang/

Viewing 15 replies - 16 through 30 (of 37 total)
  • dFactory

    (@dfactory)

    Happy to hear that @chouby. We’ll test that also.

    wordpressdennis

    (@wordpressdennis)

    hi,

    i have an “Notice: Trying to get property of non-object” error when saving/publishing a post.

    this line is the problem:
    [code]public function get_translation(...) {
    $slug = $this->get_language($lang)->slug;
    ....
    }[/code]

    it throws an error with a custom post type i use to add field sets to other (custom) post types with the plugin “Advanced Custom Fields”.

    is it possible to add a fallback? for me that works for the moment, but for sure its not a nice solution:
    [code]if(empty($this->get_language($lang)->slug)) {
    $slug = 'de';
    } else {
    $slug = $this->get_language($lang)->slug;
    }[/code]

    Plugin Author Chouby

    (@chouby)

    Thanks for reporting this. I could reproduce and debug it. This is the result of some conflict between the WPML compatibility mode of both ACF and Polylang. I will fix this in the next release.

    hansbaer

    (@hansbaer)

    I get an error message with the latest (1.2.3) version on WP 2.7.1 with the Atahualpa theme:

    Warning: Invalid argument supplied for foreach() in […]/wp-content/plugins/polylang/frontend/frontend-nav-menu.php on line 144

    $menus in the function at that position is no array apparently but is treated as one. I have made a quick fix by making an

    if(is_array($menus)) {
    // foreach code goes here
    }

    around it, but that’s not more than a dirty hack.

    Matt Gibson

    (@gothickgothickorguk)

    Yup, I’m getting the same thing with with the stock Twenty Ten theme, just seems to be some missing braces:

    public function nav_menu_locations($menus) {
    		if (is_array($menus))
    			$theme = get_option('stylesheet');
    
    			foreach ($menus as $loc => $menu) {
    				if (!empty($this->options['nav_menus'][$theme][$loc][$this->curlang->slug]))
    					$menus[$loc] = $this->options['nav_menus'][$theme][$loc][$this->curlang->slug];
    			}
    
    		return $menus;
    	}

    …the indentation suggests that there should be braces with the is_array() conditional so that the foreach is inside it to me?

    Plugin Author Chouby

    (@chouby)

    Yes that’s this… That’s not a dirty hack as it is the only way to fix if you don’t use custom nav menus.

    I included the fix (with some others) in the development version (1.2.3.2).
    https://downloads.www.ads-software.com/plugin/polylang.zip

    Matt Gibson

    (@gothickgothickorguk)

    Cool, thanks for the confirmation. Confused the hell out of me before I spotted the missing brackets (“But it’s *uninitialised*! How can it be an array?!”) ??

    gabyu

    (@gabyu)

    I have encountered an issue during the upgrade from 1.1.6. My custom menus remain in the default language (French) even I have custom menu set for every language (Fr, En and Chinese). It’s obviously a theme issue as when I’m switching back to Twenty Twelve, the problem is fixed.

    Here is how I am register my menus in functions.php

    function register_my_menus() {
    	  register_nav_menus(
    	    array(
    	      'header-menu' => __( 'Header Menu' ),
    	    )
    	  );
    	}
    	add_action( 'init', 'register_my_menus' );

    and in my template (ie. page.php):

    <nav id="nav" role="navigation">
     			<?php wp_nav_menu( array('header-menu' => 'Header Menu') ); ?>
     </nav>

    Plugins in use:
    jQuery Smooth Scroll
    kt-cleanpress
    Quick Page/Post Redirect Plugin

    My question: what’s the new, optimal recommended markup to display the menu when we use Polylang ?

    Thank you.

    Plugin Author Chouby

    (@chouby)

    The wp_nav_menu call is wrong. Here is the correct code

    <nav id="nav" role="navigation">
    <?php wp_nav_menu( array('theme_location' => 'header-menu') ); ?>
    </nav>

    See wp_nav_menu usage: https://codex.www.ads-software.com/Function_Reference/wp_nav_menu
    I really can’t imagine how it could work with Polylang 1.1.6!

    Note: The problem is that this buggy code can work without Polylang. Because if you don’t provide the theme_location argument, WordPress fallbacks to the first registered location. And if there is one unique location, you don’t notice the code is buggy ?? But with Polylang the location is no more unique… This is one of the most common mistake I find in themes.

    hansbaer

    (@hansbaer)

    Thanks for the quick reply. I am happy to see that this is one of the rare occasions that the simplest fix without any deeper understanding of the whole architecture turned out to be an actual solution ??

    Thanks and keep up the good work! Polylang is a great plugin!

    gabyu

    (@gabyu)

    Thank you for the quick reply. I have made the change and it worked.

    I had the warning problem […]/frontend-nav-menu.php on line 144 to

    The 1.2.3.2 version solved the problem for me.
    Thank you.

    Hello Chouby, I have the same error of huppellepup. Have you got a fix to this problem ?

    Plugin Author Chouby

    (@chouby)

    hi,

    i’ve found a bug in the quick-edit-function of wordpress.

    – i have 2 lanugages, german and english
    – i have e.g. a posts in this 2 languages (custom post type)
    – all is working correct, now the problem:

    1) first i edit an english post –> OK
    2) now i edit a german post –> the language dropdown show english as selected

    saving now will save this germn post as english and destoys the connection between the both posts

Viewing 15 replies - 16 through 30 (of 37 total)
  • The topic ‘Issues with Polylang 1.2.x’ is closed to new replies.