Home › Forums › Newsletter Plugin Support › The latest Ver 6.9.1 is conflicting with WP Multilang on newsletter_user_subscr
- This topic has 7 replies, 3 voices, and was last updated 3 years, 10 months ago by Stefano.
-
AuthorPosts
-
October 16, 2020 at 7:51 pm #259999hsupyaenaungParticipant
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
October 16, 2020 at 11:08 pm #260005StefanoKeymasterUhm, 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.October 16, 2020 at 11:10 pm #260006StefanoKeymasterLooking 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.
October 17, 2020 at 3:51 am #260008hsupyaenaungParticipantI 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?
October 24, 2020 at 7:55 am #260791hsupyaenaungParticipantHi,
The issue is still not yet resolved. Is there a way I can have access to older version of this plugin?
November 30, 2020 at 3:17 pm #262732sofiabsilvaParticipantHello,
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.
@stefanoDecember 7, 2020 at 1:12 pm #263167sofiabsilvaParticipantHello, 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 @stefanoDecember 7, 2020 at 4:53 pm #263171StefanoKeymasterHi, you should change the code
$data[‘profile_20’] = wpm_get_language();
to
$data->profile_20 = wpm_get_language();
-
AuthorPosts
- You must be logged in to reply to this topic.