WPML issue on WPMUDEV hosting

I am trying to use WPML on my website which is hosting on WPMUDEV. But when I activate WPML the theme library looks broken. How can I fix it?

  • Kasia Swiderska
    • Support nomad

    Hello Edoardo,

    I'm sorry to hear about this issue on your site.

    I have escalated this to our Second Line Support Developers (I want to also inform that I have created an SFTP account for this site for developers so they can investigate it).

    Our developers will check it and let you know what is happening there.

    kind regards,
    Kasia

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Edoardo ,

    I've backtraced the issue and the problem is that WPML is trying to filter the themes list but doesn't return anything within a specific check it does.

    The code is at:

    File: \wp-content\plugins\sitepress-multilingual-cms\vendor\otgs\installer\includes\class-installer-theme.php
    
    Lines 341 - 348
    
                //Default WP Themes here
                $client_side_active_tab = get_option( 'wp_installer_clientside_active_tab' );
                if ( $client_side_active_tab ) {
                    if ( !(in_array( $client_side_active_tab, $this->theme_repo )) ) {
                        //Not OTGS tab
                        return $res;
                    }
                }

    At that point WPML is trying to read a custom option that it is inserting into the database named "wp_installer_clientside_active_tab". Since that option doesn't exist in the database the code doesn't proceed to return the list via "return $res;". I've checked the code where it actually inserts that option -or- to make WPML insert it automatically but to no avail.

    To fix this for you for the time being I've changed the above code to:

    //Default WP Themes here
                $client_side_active_tab = get_option( 'wp_installer_clientside_active_tab' );
                if ( $client_side_active_tab ) {
                    if ( !(in_array( $client_side_active_tab, $this->theme_repo )) ) {
                        //Not OTGS tab
                        return $res;
                    }
                }
                return $res;

    I've just added an extra "return $res;" so it can return the themes even if the option doesn't exist.

    You should be able to browse the themes properly now with that minor fix.

    Please note that on a plugin update this fix will be lost so feel free to inform WPML for this just in case of a possible permanent fix so they can test it out on their end as well.

    Regards,
    Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.