SpeakUp! Email Petitions
[resolved] Conflict with Polylang (5 posts)

  1. jeffbbz
    Posted 3 years ago #

    Hi, I'm sorry if something easy and basic is happening, I'm a super beginner. I recently made a petition with speakup for my website. Everything was working fine and then the next day, I installed the Polylang plugin to start making my site multilingual. However, after installing Polylang, people were no longer able to sign the petition and got this error message:

    Fatal error: Call to a member function switch_lang() on a non-object in /home/imocha1/savejejuisland.org/wp-content/plugins/speakup-email-petitions/includes/ajax.php on line 14

    Although I suspected a conflict with Polylang was a problem, I de-activated it and re-activated it several times to check. When it was inactive everything was fine and when it was active i got the above error.

    Can you please help me understand the problem and what I can do it fix it? I really need to use both plugins.



  2. Kreg
    Plugin Author

    Posted 3 years ago #

    I released version 2.3.2 of SpeakUp! Email Petitions, which should fix this problem.

  3. jeffbbz
    Posted 3 years ago #

    It works great now! Thanks and thanks for the quick response!

  4. Chouby
    Posted 3 years ago #

    Hi Kreg,

    I saw from the development log what modification you made to avoid the conflict with Polylang. Maybe we can go even further and obtain the same result with Polylang as you obtain with WPML.

    If I well understand (although I don't know what is the second parameter 'true') the switch_lang function should allow to set the language in your ajax response.

    So maybe I am wrong, but maybe that simply setting the parameter pll_load_front : 1,
    at line 52 of public.js should do the job.
    The correct language will be set as Polylang will read you $_POST['lang'] variable.

    Maybe jeffbbz can make a test...

  5. Kreg
    Plugin Author

    Posted 3 years ago #


    Seems like it's worth a shot. Would be nice to have more complete compatibility with Polylang.

    I think the second parameter in switch_lang() when set to true will change the language code that WPML stores in a cookie (like 'en'). Using false might work just as well in this case.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • SpeakUp! Email Petitions
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic