Skip Navigation

[Resolved] Calling a view via Ajax break the view ordering

This support ticket is created 2 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
- 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/Karachi (GMT+05:00)

This topic contains 15 replies, has 3 voices.

Last updated by Wilhem 2 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#2460953
Capture d’écran 2022-09-19 à 16.47.39.png
Capture d’écran 2022-09-19 à 16.47.28.png
Capture d’écran 2022-09-19 à 16.47.17.png

Hello,

I'm using a view refreshed in Ajax who is calling another view with content ordered via a meta ( basically a timestamp ).

https://toolset.com/wp-content/uploads/tmp/Capture_d_e_cran_2022_09_19_a_16.47.39_1.png
https://toolset.com/wp-content/uploads/tmp/Capture_d_e_cran_2022_09_19_a_16.47.28_1.png
https://toolset.com/wp-content/uploads/tmp/Capture_d_e_cran_2022_09_19_a_16.47.17_1.png

If you call the view directly or without Ajax ( hidden link ) the order is fine.

If you call the view by clicking on the Ajax button, ordering of the second view is broken. ( hidden link then click on day 29 )

Thanks,
Wilhem

#2461385

Hello,

I assume we are talking about the post view "Projections / film / jour ( AJAX )":
hidden link

There isn't any frontend sortby control in it, are you going to filter the results by a custom date field "p-date"?
Please confirm it, thanks

#2461393

Hi Luo,

Exactly, that view is calling another view : Projections \ jour ( projections-jour).

That second view is filtered by p-date and is ordered by a field called p-start-and-stop-time__begin which is basically a timestamp to help ordering.

That order is broken by the Ajax loading.

Thanks a lot,
Best regards
Wilhem

#2461953

Thanks for the details, I can see the difference, please backup your website first, since you are using 49 plugins, there might be other compatibility issues in your website, please backup your website, then update here, I might need to deactivate plugins in your website, thanks

#2461987

Hi Luo,

Well, thanks a lot.
I can propose you another solution, if you think it will work for you : we have a pre-prod version for another website, but with exactly the same issue AND 98% same views.
You should able to deactivate all plugins you want and run tests on it. It's not a live version.

What do you think ?
( backup will be very very heavy — unless we skip upload content )

If it's ok for you, I will need you IP adress in private and I will need to reply to you privately.

If not, I still can backup for you.

Best regards,
Wilhem

#2462153

Hi Luo,

Client is complaining about a debug on film pages. Is it you ?

object(WP_Query)#28900 (48) ...

#2462215

Luo, I found your debug, I can't let a debug in website for hours because website is an international film festival opening in few days ! So there is traffic at the moment.
Thanks a lot !

#2462677

Sorry, I forget to deactivate the custom code snippet:
hidden link

In order to debug this issue without breaking your website, please provide a copy of your website in below private message box:
https://toolset.com/faq/provide-supporters-copy-site/
you can put the package files in your own google drive disk, share the link only

#2462813
#2463411

Thanks for the details, I am downloading the files, will update here if find anything

#2467245

Hello Luo,

Hope you are fine ; did you found something for my issue ?

Best regards,
Wil

#2468811

Hi Wil,

Luo is on vacation so I'll be following up on this ticket.

I will review this discussion, perform some tests, and share the findings accordingly.

Thank you for your patience.

regards,
Waqar

#2469993

I've performed some tests on my website, but couldn't reproduce this issue.

This suggests that something specific to your website is involved. I'm currently downloading your website's clone.

It is a large file, so this investigation will take some more time. But, I'll keep you updated on the progress.

#2470645

Ok, don't hesitate if you need help to find something.

#2473327

I just wanted to let you know that I successfully deployed your website's clone on my test server.

We had an unusually busy forum queue over the weekend, but, I'll be resuming the troublshooting on this, today.