Support » Plugin: Polylang » Fatal error: … get_default_language()

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    It seems that Avada tries to detect the presence of WPML by testing a constant present in both Polylang and WPML. And then Avada being “sure” that WPML is present, it tries to use an internal function of WPML. But of course, Polylang does not provide this function… and you get this ugly fatal error.

    So please report your error to the Avada team and ask them if they can support Polylang or if they can use a constant / function /class unique to WPML so that the theme does not believe anymore that Polylang is WPML.

    Waiting for this, you can put:
    define('PLL_WPML_COMPAT', false);
    in your wp-config.php

    This will disable the WPML compatibility mode of Polylang and should solve the fatal error.

    Plugin Author Chouby

    (@chouby)

    Thanks, it works.

    So, I understand that Avada theme has WPML functions by default , Avada theme was created thinking to use WPML plugin, right?

    I’ll write Avada theme to tell what you are saying, but I think they will write me back saying it will be consider for next updates.

    So, my question is, using “define(‘PLL_WPML_COMPAT’, false);” can my web site exists without problems?

    Thank you very much!

    Plugin Author Chouby

    (@chouby)

    Hi!

    I won’t say that it will work without problem. It much depends on your needs. You won’t take profit of multilingual features of your plugins which are compatible with WPML and Polylang through WPML compatibility mode (such as WordPress SEO).

    Hello.

    I inserted the suggested code
    define(‘PLL_WPML_COMPAT’, false);
    into my wp-config file which resolved the fatal error, but it does not return the function of Polylang. i.e. the language switcher does not function and all (spanish and english) assigned posts show up together in the gallery as duplicated images instead of single images per language selection.

    As Avada and Polylang were working just fine together before the last (2) updates – i.e. the problem occurred when I updated Polylang – is it not possible to reinstall the previous version that was stable with Avada?

    Thank you

    Incidentally, don’t know how relevant, but I found the following code already in the config file and I don’t know what it’s function is, but I tried removing that as well which made no difference, so I put it back along with your suggested code above.
    define (‘WPLANG’, ”);

    Plugin Author Chouby

    (@chouby)

    Hi!

    Yes. It worked with previous versions of Polylang. I improved the WPML compatibility mode and it should be good for most users. I am sorry that it created an issue with Avada. But as the error message says, the error is in Avada. If the Avada authors can have a look to my blog post, I believe that it will be easy for them to solve the issue.

    I forgot to mark this topic as resolved. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Fatal error: … get_default_language()’ is closed to new replies.