Home Forums Newsletter Plugin Support The latest Ver 6.9.1 is conflicting with WP Multilang on newsletter_user_subscr

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #259999
    hsupyaenaung
    Participant

    After updating to latest version, the subscribe form can’t function as it is conflicting with wp-multilang plugin. I’d done tons of localisation (translations) with wp-multilang, and the wp-multilang barely do their updates. I believe if I can disable wp-multilang just on newsletter subscribe, everything can still function as it should? Thanks for the help.

    Fatal error: Uncaught Error: Cannot use object of type TNP_User as array in …/plugins/wp-multilang/includes/integrations/class-wpm-newsletter.php:82 Stack trace: #0 …/wp-includes/class-wp-hook.php(287): WPM\Includes\Integrations\WPM_Newsletter->save_profile_20(Object(TNP_User)) #1 …/wp-includes/plugin.php(206): WP_Hook->apply_filters(Object(TNP_User), Array) #2 …/plugins/newsletter/subscription/subscription.php(590): apply_filters(‘newsletter_user…’, Object(TNP_User)) #3 …/wp-content/plugins/newsletter/subscription/subscription.php(179): NewsletterSubscription->subscribe2(Object(TNP_Subscription)) #4 …/wp-includes/class-wp-hook.php(287): NewsletterSubscription->hook_newsletter_action(‘s’, NULL, NULL) #5 …/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array) #6 …/wp-includes/plugin.php( in …/plugins/wp-multilang/includes/integrations/class-wpm-newsletter.php on line 82

    #260005
    Stefano
    Keymaster

    Uhm, it seems we changed a parameter passed with an action/filter call from an array to an object. I’ll look into it.
    Ask the developers to check if the received subscriber is an array or an object and act consequently.

    #260006
    Stefano
    Keymaster

    Looking at our documentation the subscriber should be an object, https://www.thenewsletterplugin.com/documentation/developers/dev-newsletter-hooks/, but I suspect there were an error somewhere and it was passed on as an array.

    #260008
    hsupyaenaung
    Participant

    I believe it has something to do with this filter in the file named class-wpm-newsletter.php at Wp Multilingual plugin folder.

    class WPM_Newsletter {
    
    	/**
    	 * WPM_Newsletter constructor.
    	 */
    	public function __construct() {
    		...
    		...
    		...
    		add_filter( 'newsletter_user_subscribe', array( $this, 'save_profile_20' ) );
    		...
    	}
    ...
    	public function save_profile_20( $data ) {
    		$data['profile_20'] = wpm_get_language();
    
    		return $data;
    	}
    	public function translate_email( $text, $user ) {
    
    		if ( is_object( $user ) && $user->profile_20 ) {
    			$text = wpm_translate_string( $text, $user->profile_20 );
    		}
    
    		return $text;
    	}

    Is there a way I could put some code at my theme function.php to have a fix around this for now?

    #260791
    hsupyaenaung
    Participant

    Hi,

    The issue is still not yet resolved. Is there a way I can have access to older version of this plugin?

    #262732
    sofiabsilva
    Participant

    Hello,
    I’m having the same problem! What can we do to fix it?
    Unfortunately I only noticed it a few days ago, haven’t had new subscribers in a while because of this.

    @stefano

    #263167
    sofiabsilva
    Participant

    Hello, I had to revert to version 6.8.9 of the newsletter plugin for it to work again, so the problem seems to be with version 6.9.0 onwards! Hope there aren’t any security issues for now.

    @hsupyaenaung
    @stefano

    #263171
    Stefano
    Keymaster

    Hi, you should change the code

    $data[‘profile_20’] = wpm_get_language();

    to

    $data->profile_20 = wpm_get_language();

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.