Skip Navigation

[Resolved] Views using repeating fields can't be sorted correctly on front end

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 9 replies, has 3 voices.

Last updated by PaulS4783 1 year, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2599027

Using Types 3.4.16
Using Views 3.6.3

I am using Beaver Builder (NOT repeat NOT the Block Editor)

I am trying to sort a set of repeating fields in the same order in which they are displayed on the dashboard using Views.
However the sort order on the front end appears to be somewhat random.

Here is the Views configuration:
hidden link

Here is the Custom Post Dashboard:
hidden link

But here is the output:
hidden link

Your help would be greatly appreciated.

#2599217

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2023-04-25 at 15.30.29.png

Hi there

I just tested this on my local site where it works as expected, I'm not sure why it wouldn't be working in your case.

Can you go to Toolset > Settings > Front-end Content and enable the advanced debug mode.

Then visit the post where the View is displayed and check the debug pop-up.

In the screenshot from my site you can see that the query arguments specify that the ordering should be by the custom field toolset-post-sortorder, and the generated MySQL query does indeed order by that custom field.

Can you share the same from your site?

#2599397
Screen Shot 2023-04-26 at 12.51.35.png

I think it's the same as yours.

Can I give you Admin dashboard access to this site to take a look at it?

I've tried deactivating plugins but doesnt make any difference.

#2599537

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

That does look right, perhaps there is something wrong in how the toolset-post-sortorder field is stored.

Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.

Can you also confirm which View we are looking at and where it is displayed?

#2600043

Hi,

Thank you for sharing the admin access details.

I tried to log in using the admin login page, but it keeps blocking me with the message:
'403 Forbidden - BBQ Firewall'

Can you please temporarily disable this 'BBQ Firewall' until this investigation concludes?

regards,
Waqar

#2600057

OK. Sorry about that. Try it again now.

#2600599

It seems like the firewall rejected because the attempted login url was malformed.

You can login at the standard /wp-login.php site address.

#2600821

The admin access details worked, thank you.

I'm currently performing some tests on my website with a similar setup and will share the findings, as soon as this testing completes.

Thank you for your patience.

#2601463

Thank you for waiting.

I was able to make the repeating field entries show in the order that you wanted by making the following changes, in the ordering section:

1. The 'toolset-post-sortorder' field stores the numerical values. So the comparison type needs to be 'As a number' instead of 'As a native custom field'.

2. The numbers in this field are stored in the ascending order. For showing the repeating field group entries in the same order as on the post-edit screen, the ordering direction needs to be 'Ascending'.
( screenshot: hidden link )

After making these changes, I cleared the 'SG cache', and repeating field items are showing in the correct order now.
( screenshot: hidden link )

#2601717

My issue is resolved now. Thank you!

Grateful to ToolSet support team for helping resolve this one.