• Resolved dannyboy84

    (@dannyboy84)


    Hello,

    When I update a page or post on my site I get a ‘fatal error’ message which comes up which links the problem to Multisite Language Switcher Plugin.

    Summary test is here –

    The theme has encountered a problem that it cannot recover from. Please use the following information to try to resolve the problem.

    Error Code: php_code_error:1:/home/freeespa/public_html/hillcrestlabs.com/wp-content/plugins/multisite-language-switcher/includes/MslsMain.php:94:Call to a member function get_language() on a non-object
    Message: A fatal code error occurred.

    Image of full error message is here: https://www.dropbox.com/s/sbmh1jiswl2t7a1/Wordpress%20Error.JPG?dl=0

    Any ideas of what is going on / how to fix it?

    Thanks, Daniel

    https://www.ads-software.com/plugins/multisite-language-switcher/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    Did you finish the setup of the plugin?

    Thread Starter dannyboy84

    (@dannyboy84)

    Yes, the plugin had been working for about 1 year. However, recently it has broken and no longer displays the other languages but I haven’t had a chance to fix it yet.

    Plugin Author Dennis Ploetner

    (@realloc)

    Please describe your setup a little bit because the plugin is not broken. I cannot help if I have to guess what’s going on.

    So, please, check

    • if you have the latest version
    • if you finished the setup and
    • if you have not modified the blog_collection-object using a hook

    Thanks!

    Thread Starter dannyboy84

    (@dannyboy84)

    Hi – sorry when I said ‘broken’ I meant on my site not in general!

    So:

    – Finished the setup – Setup is finished – as I mentioned it was working for around a year. However, now only the link to the ‘current’ language shows up on each page (i.e. US on Us site, Chinese on Chinese site, etc), so maybe something became undone in an update? Looking at the settings under Settings/General and Settings/Multisite Language Switcher everything seems to be complete. Is there a way of checking if I have completed setup?

    – Modified the blog_collection – So I remember having to change something here a while ago to get the other languages to show up. I think I changed the msls_blog_collection_construct as described on this page – https://msls.co/hooks-filters-and-actions/.

    Thanks, Daniel

    Plugin Author Dennis Ploetner

    (@realloc)

    OK, do you mind to post the function that modifies the blog_collection? And could you post the IDs of you blogs too?

    Thread Starter dannyboy84

    (@dannyboy84)

    I’m sorry – I edited it so long ago I am not sure where to find it any more – could you point me in the right direction?

    Is is plugins/editor/multisite-language-switcher/includes/MslsBlogCollection.php?

    And where would I find blog IDs?

    Sorry for the basic questions.

    Plugin Author Dennis Ploetner

    (@realloc)

    No, it should be a function in the file functions.php. Or make a search in all files for “add_filter( ‘msls_blog_collection_construct’,…”. If you really modified the plugin files (what you should not do) then get first a clean version.

    For the IDs:

    When you are in /wp-admin/network/sites.php you’ll see a list of the sites in your network. When you go over the sites with your mouse you’ll see links like /wp-admin/network/site-info.php?id=X (X is the ID).

    Thread Starter dannyboy84

    (@dannyboy84)

    Thanks so much!

    Ok, so here is the modifier:

    function my_msls_blog_collection_get( $arr ) {
    $arr = array();
    foreach ( array( 1, 2, 3,) as $id ) {
    $arr[$id] = get_blog_details( $id );
    }
    return $arr;
    }
    add_filter( ‘msls_blog_collection_construct’, ‘my_msls_blog_collection_get’ );

    and the IDs:
    https://hillcrestlabs.com/wp-admin/network/site-info.php?id=1
    https://hillcrestlabs.com/wp-admin/network/site-info.php?id=2
    https://hillcrestlabs.com/wp-admin/network/site-info.php?id=3

    Plugin Author Dennis Ploetner

    (@realloc)

    OK, all these 3 websites are configured? And all of them have different languages? Please check this!

    Thread Starter dannyboy84

    (@dannyboy84)

    Hi – I think you may have found the issue! I am using the WordPress Language plugin to make the admin panel language is english even on the other language sites and it looks like that might be defaulting the language to english in all of the sites as it seems to overwrite the Settings/General language setting.

    I will follow up with the authors of that plugin to see if I can resolve.

    Thanks!

    Plugin Author Dennis Ploetner

    (@realloc)

    You don’t need this plugin because the Multisite Language Switcher can do that too. Please have a look in the settings of the plugin.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Fatal Error’ is closed to new replies.