• Resolved Arno Welzel

    (@awelzel)


    I just updated from MSLS 1.1 to 2.0.2. After this update the whole website behaves as if there was no MSLS installed at all.

    There are still MSLS settings in the backend, but the existing posts and pages are not connected between the sites any longer and also the class MslsOutput as documented in https://msls.co/functions-classes-and-methods/.

    I already learned, that one needs to use lloc\Msls\MslsOutput::init(); now instead of creating a new instance of MslsOutput. I can also manually connect the affected posts and pages again in the backend and this will be stored – but manually restoring about 365 post connections and 65 page connections is not really a solution.

    As soon as I restore everything to MSLS 1.1 everything is OK again. So it looks like there is a problem when updating from 1.1 to 2.0.2.

    Any idea?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Arno Welzel

    (@awelzel)

    Update:

    One problem seems to be how MSLS stores the connections in the site options.

    With MSLS 1.1 the language was stored as two character code (e.g. “en” and “de”). The new version uses the full code including the region (e.g. “en_US” and “de_DE”). Therefore all the existing options don’t work any longer :-(.

    And even worse – this affects all website where I use MSLS at the moment.

    I can manually fix the database by dumping the options tables, replacing the language code for all options starting with “msls_” and importing the table again – but this still looks like a bug in the update. The update should also update the affected option values or try to accept the old short form as well.

    Thread Starter Arno Welzel

    (@awelzel)

    More wonders to explore… I found even more variations, examples from different websites:

    a:1:{s:5:\"en_US\";i:293;}

    a:1:{s:2:\"en\";i:765;}

    a:1:{s:2:\"us\";i:131;}

    Only the version with a:1:{s:5:\"en_US\";i:193;} works with 2.0.2. The other two variations don’t work at. I manually have to update the database records first.

    Plugin Author Dennis Ploetner

    (@realloc)

    Thanks for the analysis, Arno … I will check that. I’m sure there is a problem with en_US right now – and that can be fixed today. I’m quite sure that MSLS saved de_DE but I will certainly control it too.

    Plugin Author Dennis Ploetner

    (@realloc)

    Hey, Arno … I send version 2.0.3 to the Github repository. It will copy the keys “en” or “us” to “en_US” in case these values are present.

    This should resolve the issue. I will test it and publish it soon in the SVN at www.ads-software.com.

    Let me know!

    Thread Starter Arno Welzel

    (@awelzel)

    Thanks for the quick response! I’ll check that with a test case and let you know about the results.

    Thread Starter Arno Welzel

    (@awelzel)

    I’m sorry, but version 2.0.3 does not fix this problem.

    The existing values for the “msls_nnn” options stay as they are (with “us” instead of “en_US”) and the translation connections get lost.

    The root cause of the problem is the way how get_language() works in the plugin. Before it returned the value us as default and now it returns en_US:

    Version 1.1:

    	/**
    	 * Get the language stored in this object
    	 * 
    	 * This method returns the string 'us' if there is an empty value in language. 
    	 * @return string
    	 */
    	public function get_language() {
    		return( empty( $this->language ) ? 'us' : $this->language );
    	}

    Version 2.0.3:

    	/**
    	 * Gets the language stored in this object
    	 *
    	 * @param string $default
    	 *
    	 * @return string
    	 */
    	public function get_language( $default = 'en_US' ) {
    		return empty( $this->language ) ? $default : $this->language;
    	}

    Using en_US as default is fine – but then the existing values must be changed in the database during a plugin update as well (in my plugin “Lightbox with Photoswipe” also do some database upgrades if needed – the code on Github).

    Plugin Author Dennis Ploetner

    (@realloc)

    Please, check the set method in MslsOptions. There is the interesting part…

    Thread Starter Arno Welzel

    (@awelzel)

    I see. Yes of course this fixes it. Maybe I did not look carefully enough, but indeed it works now. Sorry for the confusion.

    Plugin Author Dennis Ploetner

    (@realloc)

    No problem ?? … Thanks for your help!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Update from MSLS 1.1 to 2.0.2 broken?’ is closed to new replies.