• Resolved isaac85

    (@isaac85)


    Hey man,

    This is a really fantastic plugin and is exactly what we need for our Thanksgiving catering service. But I have a problem. I input several menu items and started setting up the page. Then I installed Polylang plugin since I need the site in 2 languages and I now see the following error page when I try to log into the WordPress admin. Any ideas?

    Thanks,
    Isaac

    Fatal error: Uncaught Error: Call to a member function get_current_language() on null in /data/www/21099/thanksgiving_cz/www/wp-content/plugins/wppizza/classes/class.wppizza.wpml.php:61 Stack trace: #0 /data/www/21099/thanksgiving_cz/www/wp-content/plugins/wppizza/classes/class.wppizza.wpml.php(682): WPPIZZA_WPML->__construct() #1 /data/www/21099/thanksgiving_cz/www/wp-content/plugins/wppizza/includes/setup/required.files.inc.php(117): require_once(‘/data/www/21099…’) #2 /data/www/21099/thanksgiving_cz/www/wp-content/plugins/wppizza/wppizza.php(189): require_once(‘/data/www/21099…’) #3 /data/www/21099/thanksgiving_cz/www/wp-content/plugins/wppizza/wppizza.php(83): WPPIZZA->requires() #4 /data/www/21099/thanksgiving_cz/www/wp-content/plugins/wppizza/wppizza.php(202): WPPIZZA::instance() #5 /data/www/21099/thanksgiving_cz/www/wp-content/plugins/wppizza/wppizza.php(205): WPPIZZA() #6 /data/www/21099/thanksgiving_cz/www/wp-includes/class-wp-hook.php(298): wppizza_ini(”) #7 /data/www/21099/thanksgiving_cz/www/wp-includes/ in /data/www/21099/thanksgiving_cz/www/wp-content/plugins/wppizza/classes/class.wppizza.wpml.php on line 61

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author ollybach

    (@ollybach)

    Hi
    this isnt really a wppizza shortcoming as such from what i can see, but polylang not accounting for legacy WPML functions (polylang pretty much hijacks most/all WMPL functionality)

    that said, as get_current_language() is somewhat deprecated anyway, i can probably account for that regardless.

    to make sure this works as i would assume it to be , can you please do the following and let me know if this works. if so, i will simply add/change this in the next update of the wppizza plugin too.

    so, do this:
    in wppizza/classes/class.wppizza.wpml.php you will find (on approx line 61)

    if($sitepress->get_current_language() != $sitepress->get_default_language()){
    REPLACE this with
    if(ICL_LANGUAGE_CODE != $sitepress->get_default_language()){

    furthermore, in wppizza/classes/class.wppizza.categories.php on approx line 117 you will find

    $current_language = $sitepress->get_current_language();

    simply delete that line (it’s not doing anything anyway)

    let me know if this works

    thanks

    Thread Starter isaac85

    (@isaac85)

    Hi,
    Thanks so much for the quick reply.

    The main problem is that I can’t even log in to my WordPress admin page. I just get that error. Is there another way to access the css so I can make your suggested changes?

    Thanks

    Plugin Author ollybach

    (@ollybach)

    you’d need login via ftp and disable the wppizza plugin (simply renaming the wppizza plugin from wppizza to -wppizza should work)

    then do the edits in the files as mentioned above and renaming it back to wppizza

    (i dont know what you mean by “access the css” but i assume thats a typo and you meant to say “cms”)

    Thread Starter isaac85

    (@isaac85)

    OK, I’m having some trouble logging into the FTP server too, but my hosting company is looking into it. I’ll try all this and let you know. Thanks!

    Thread Starter isaac85

    (@isaac85)

    I made the changes you suggested and I’m still getting that same error. Any other ideas?

    Thanks,

    Isaac

    Plugin Author ollybach

    (@ollybach)

    you will have to contact the authors of polylang I’m afraid

    I’m only really actively supporting WPML integration and the error you are getting is from a standard WPML function (namely get_default_language() )

    polylang however hijacks most WPML functions and to me this looks like they have simply forgotten to account for that particular function .

    that said, if they reply to you and can suggest another *wpml* function or *wmpl* constant instead, i’d be happy to use that instead in future versions

    (ps: these MUST be WPML functions/constants not anything unique to polylang)

    Thread Starter isaac85

    (@isaac85)

    OK cool, I’ll get in touch with them.

    One more question for you: where can I edit the shopping cart widget? I need the title to by Shopping Cart instead of shoppingcart.

    Thanks!

    Plugin Author ollybach

    (@ollybach)

    >where can I edit the shopping cart widget?
    errr, have you tried appearance->widgets ?

    Thread Starter isaac85

    (@isaac85)

    Nope, I went through all the wp-pizza options but Widgets settings makes much more sense :). All taken care of, thanks!

    Also, this is the reply I got from Polylang. I’m keeping my site single-language for simplicity’s sake, but just in case you’re curious:

    “This is a bug in wppizza. This plugin uses a function without correctly checking that it exists. See: https://polylang.pro/fatal-error-call-to-a-member-function-on-a-non-object-in/”

    Plugin Author ollybach

    (@ollybach)

    >All taken care of, thanks!
    ok

    >This is a bug in wppizza….
    I beg to differ on that front as it’s polylang that hijacks WPML . It’s a bit rich for them to say it’s a bug in another plugin if they are effectively altering the behaviour of WPML. adding a function_exists to every call of a function a plugin has in itself is just silly.

    Plugin Author ollybach

    (@ollybach)

    i had a bit of a rummage around out of curiosity and the following *MIGHT* work around what i personally consider the shortcomings of polylang rgarding WPML compatibility

    so try this:
    instead of using
    if(ICL_LANGUAGE_CODE != $sitepress->get_default_language()){
    as mentioned above try

    
        	$wpml_default_language = is_object($sitepress) ? $sitepress->get_default_language() : apply_filters('wpml_default_language', '');
        	if(ICL_LANGUAGE_CODE != $wpml_default_language){
    

    this might just work – let me know…

    • This reply was modified 7 years ago by ollybach.
    Thread Starter isaac85

    (@isaac85)

    Nope, same error.

    Plugin Author ollybach

    (@ollybach)

    ok, thanks for trying though
    was worth a shot at least

    Hi Oliver,

    Thanks again for developing this great plugin.

    I’ve the same fatal error since my last update, and I also installed Polylang on my website. Did you find the solution to fix this error?

    Thanks.

    Helen

    Plugin Author ollybach

    (@ollybach)

    there is no solution
    polylang won’t work with wppizza as polylang isnt WPML cpmpatible

    they even know about this
    https://polylang.pro/fatal-error-call-to-a-member-function-on-a-non-object-in/

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Fatal error after installing Polylang’ is closed to new replies.