Skip Navigation

[Resolved] Conditional not work after redirect page [con't]

This support ticket is created 2 years, 10 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 17 replies, has 2 voices.

Last updated by Luo Yang 2 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#2048565

Dear Sir/Madam,

Sorry for my late reply to below ticket, the ticket is now closed but I need further help.
https://toolset.com/forums/topic/conditional-not-work-after-redirect-page/#post-2011159

Please kind allow me to provide private message in next reply.

Best regards,

Kelvin.

#2048719
#2048723

Dear Sir/Madam,

Sorry, I can't wait for the solution as the site has to be launched.

I temporarily remove the condition and always show the button that the logged-in user should see.

I also add below code to troubleshoot the issue from the home page

	<div style="display: none;">1. Current-user info id is [wpv-current-user info='id']</div>

	[wpv-conditional evaluate="false" if="('[wpv-current-user info='id']' eq '')"]
		<div style="display: none;">2. assume user is login. Current-user info id is [wpv-current-user info='id']</div>
	[/wpv-conditional]
	[wpv-conditional if="('[wpv-current-user info='id']' eq '')"]
		<div style="display: none;">3. assume user is not login. Current-user info id is [wpv-current-user info='id']</div>
	[/wpv-conditional]      

I also add the above code to /my-applications/ page where the page will be redirected after login.

You may need to view the result using web inspector.

Below are the steps to replicate the issue:

1. login to the site /wp-login.php
2. /my-applications/ will be redirected, I can find the [wpv-current-user info='id'] value
3. click to /about/ and then home / , the [wpv-current-user info='id'] value is empty
4. click to /my-applications/, the [wpv-current-user info='id'] value is existed
5. click to home / again, the [wpv-current-user info='id'] value is empty again
6. reload the home /, the [wpv-current-user info='id'] value shows up

Initially, I guess the issue might be caused by the cache, I disable the cache plugin but the issue still exists.

Could you please help to investigate the issue why [wpv-current-user info='id'] so able to load until reload the home page?

Best regards,

Kelvin

#2050193

Hello,

As your request, I have enabled the private message box, please provide your website credentials in it. thanks

#2052653
user-id.JPG

I have tried these in your website with my chrome browser:
1) Login as user "toolset"
2) Edit the home page, add a shortcode block in the page bottom:
wpv-current-user ID: [wpv-current-user info='id']

2) Follow the steps you described in post:
https://toolset.com/forums/topic/conditional-not-work-after-redirect-page-cont/#post-2048723
In steps "5. click to home / again ..."
I can see the correct result without any problem, see my screenshot user-id.JPG

Is this problem resolved? it might be a browser cache problem, please try to clear your browser cache or try with another browser, and test again.

#2053863

Dear Luo Yang,

I use Chrome Incognito Windows to test with below steps

1. Click 登入/註冊 from menu
2. Google login
3. Click the home page

I can't get the user id.

Best regards,

Kelvin

#2053887

I have setup the shortcode block in your home page again:
hidden link

Please login your website with the same user "toolset" you provided above:
https://toolset.com/forums/topic/conditional-not-work-after-redirect-page-cont/#post-2051483

And test it using the steps you mentioned above:
https://toolset.com/forums/topic/conditional-not-work-after-redirect-page-cont/#post-2048723

I have double checked it in your website, it works fine.

#2053971

Dear Luo Yang,

As the toolset account is an administrator role, it can't be simulated the same flow of the issue, I created an account toolsetuser as subscriber, password is same as toolset, I tested and issue found.

Step to test:
1. login as toolsetuser
2. click the Home

#2054797
user-id-10.JPG

I have tried as you mentioned above, it works fine:
1) Login as user "toolsetuser"
2) Continue with my own Google account
3) click the Home
I can see correct user ID value: 10.

See my screenshot user-id-10.JPG

#2055553

Dear Luo Yang,

Why you log in as a user 'toolsetuser' and then continue with your Google account? It should be either login as toolsetuser or google account, your steps were not the same as mine.

Best regards,

Kelvin.

#2055561

Dear Luo Yang,

I don't know how to explain, I didn't get the current user id, I screen record the issue, hidden link

Please have a look.

#2057183
video-record.JPG

I have tried the video record, but get 404 error, see my screenshot, please check it.

#2057197

Dear Luo Yang,

Sorry for my careless, missing folder name, here you go hidden link

Best regards,

Kelvin

#2057239

Thanks for the video, that is the browser cache problem, it occurs when user load the home page from the local browser cache instead of from your webserver, and can be fixed after user refresh browser.

You might consider to disable the browser cache of the home page, for example:
https://stackoverflow.com/questions/49547/how-do-we-control-web-page-caching-across-all-browsers

#2057475

Dear Luo Yang,

I don't agree to request visitors to manually refresh or disable the browser cache. How can I force the page with the wpv-condition be reloaded? I don't understand why the page /my-applications/ has no such issue but only the home page?

Best regards,

Kelvin.

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