• Here’s the problem: if you open your wp-admin in two (or more) tabs (e.g. when editing several posts simultaneously), and if there are different languages selected in each tab, when you update (save) any post, the content entered will be saved as the recently selected language (even if it was selected in another tab) – OVERWRITING whatever was there.

    How to reproduce: configure wp-multilang to use two languages. Create two posts with content in these two languages. Edit both posts in two browser tabs. In tab 1 select language 1, in tab 2 select language 2. Go back to tab one, enter content in language 1, publish it. The content of post 1, language 1 will not be changed, but the content of post 1, language 2 will be overwritten with what you entered using language 1.

    What every user expects to happen is to have the content of post 1 be updated for language 1, as that was the language selected in this brower’s tab.

    In other words: wp-multilang stores active language information globally (in a cookie?) on admin pages and doesn’t check for the selected tab when updating the post.

    Any ideas how to fix this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter michalszota


    Here’s what I discovered. If I manually add the “?edit_lang” param to <form id=”post” action=”post.php”> on edit page, things work correctly.

    Thread Starter michalszota


    And this is a hacky solution to the problem (add to functions.php in your theme):

    function msz_footer_admin () {
    	jQuery(function ($, undefined) {
            if ($('#wpm-language-switcher .nav-tab-active').length) {
                $('form#post').attr('action',$('form#post').attr('action')+'?edit_lang='+$('#wpm-language-switcher .nav-tab-active').data('lang')); 
    add_filter('admin_footer_text', 'msz_footer_admin');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug: editing content in several browser tabs overwrites entries for wrong lang’ is closed to new replies.