Skip Navigation

[Resolved] Getting disconnected when submiting form

This support ticket is created 8 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 8 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#362504

I added a function to force user to be logger on the site.

function force_login() {

	if (is_user_logged_in()&& is_page() || is_user_logged_in() && is_single()  ){
		return;
	}
	else if(!is_user_logged_in()){
		auth_redirect();
	}else{
		return;
	}
}

Work fine except when i submit a specific form in cred, i get disconnected and redirected to the login page.
If i connect again the form will get submitted and the post get updated.
I try a couple of other method to check if the user is logged in but i get the same exact behavior as soon as i submit the form.

#362572

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

1)
As I understand CRED form should also displayed to loggedin users only?

2)
Could you please activate WP_DEBUG from wp-config.php file and check for any possible errors.

3)
Could you please try to resolve your issue by deactivating all third-party plugins as well as with the default theme to check for any possible conflicts with any of the plugins or themes?

#362755

1- Yes the whole site required the user to be logged
2- Debug is activated and show nothing
3- Problem is with the is_user_logged_in function. When the form is submitted and the page start reloading the function return an incorrect value. If I remove the call to that function everything work correctly

#363059

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What if you try to check status of user if user is loggedin or not using [wpv-conditional] shortcode:

For example:

[wpv-conditional if="( '[wpv-current-user info="logged_in"]' eq 'true'' )"]
display CRED form
[/wpv-conditional]

More reference:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
=> https://toolset.com/documentation/views-shortcodes/#vf-153354

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.