• Hello,

    I would like to inform the plugin’s creator that having a single language in the general languages settings causes multiple warnings while saving post/page.

    Here are some examples:

    Warning: Invalid argument supplied for foreach() in plugins/polylang/include/admin-filters.php on line 387
    >>> foreach ($_POST[‘post_tr_lang’] as $lang=>$tr_id)

    Warning: Invalid argument supplied for foreach() in /home/ahavaves/public_html/wp-content/plugins/polylang/include/admin-filters.php on line 393
    >>> foreach ($translations as $lang=>$tr_id) {

    It was detected in WP3.3.1 and Polylang 0.7pre14.

    In most (if not all) cases there will be more than one language, in addition, creating a second language (even if it is not used for now) will solve the problem and can be considered as a workaround here.

    Goodluck!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thank you for the bug report. I will look at this to be cleaner…

    Please keep the ‘polylang’ tag as is, as I receive by email all topics linked to this tag. Of course, you can add other tags if you want.

    I am currently working on this bug. Although I perfectly understand what’s wrong in Polylang’s code and so will correct it, I did not succeed to display these warnings on my test site without modifying the code. I guess that these warnings are sent before WordPress redirection occurs and so I don’t see them. So I am curious to know in which circumstances you got these warnings. Knowing this could help me detecting other similar bugs.

    Thread Starter cybup

    (@cybup)

    I haven’t done something special other than running WP3.3.1 with Network (MultiSite), installed Polylang plugin, configured single Language, and tried to publish/update a post/page (in that order).

    I assume the ‘Network/Multisite’ might be the difference here 🙂
    If you haven’t tried recreating it on a ‘Network/Multisite’ then I would suggest to try and see the results…

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Polylang] – Errors when only one language exists’ is closed to new replies.