Skip Navigation

[Resolved] Post relationships displayed in post editor columns displayed repeating multiple

This support ticket is created 2 years, 5 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 6 replies, has 2 voices.

Last updated by Waqar 2 years, 5 months ago.

Assisted by: Waqar.

Author
Posts
#2423655
2022-07-23_05-53-37.png

Tell us what you are trying to do? I want to display a relationship box fields in the post editor with only one value. Right now, the same value is displayed multiple times.

What is the link to your site? hidden link

#2424407

Hi,

Thank you for contacting us and I'd be happy to assist.

To troubleshoot this, I'll need to see how this relationship and the field are set up in the admin area.

Can you please share temporary admin login details in reply to this message?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2424795

Thank you for sharing the admin access.

I can see the issue of repeating custom field values in the relationship box section on your website, but I couldn't reproduce this on my test website. This suggests that something specific to your website is involved.

To troubleshoot this, I'll suggest the following steps:

1. Please make sure that WordPress, active theme, and plugins are all updated to the latest versions.

2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One.

If it's fixed, you can start adding the disabled items, one by one, to narrow down to a possible conflicting one.

3. In case the issue still persists, I'll need your permission to download a clone/snapshot of the website, to investigate this on a different server.

I hope this helps and let me know how it goes.

#2427749

1. Please make sure that WordPress, active theme, and plugins are all updated to the latest versions.
Done, still not working as expected.
2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One.
Done, still not working as expected. I disactivated every other party plugin one after the other and set the theme to Twnety Twenty-One.
Related fields are still displaying the same value mulitple times. hidden link.

3. In case the issue still persists, I'll need your permission to download a clone/snapshot of the website, to investigate this on a different server.
You have my permisson. THANKS!

#2428823

Thanks for the update and the permission.

I've downloaded the duplicator package from the website and currently performing some tests.

Will share the findings, as soon as this testing completes. Thank you for your patience.

#2429685

Just wanted to let you know that I'm still working on this and will share the findings, within the next few hours.

#2430289

Thank you for waiting, while I completed this investigation.

It turns out duplicate records exist for the custom field values in the database, which is why they are also showing as repeated in the relationship meta box.

Had you performed any import of the content specifically for the custom field data?

To remove the repeated/duplicated custom field records, you can run some SQL queries on the database, using a tool like phpMyAdmin, as explained in this guide:
hidden link

For example, to remove the duplicated records for the custom field with key 'wpcf-annee-numero' from all the posts on the website, the SQL query will look like this:


delete from wp_postmeta
where meta_id in (
       select *
       from (
               select meta_id
               from wp_postmeta a
               where a.meta_key = 'wpcf-annee-numero'
               and meta_id not in (
                       select min(meta_id)
                       from wp_postmeta b
                       where b.post_id = a.post_id
                       and b.meta_key = 'wpcf-annee-numero'
               )
       ) as x
);

Similarly, you can repeat the same for any other custom field key too.

I hope this helps and please let me know if you need any further assistance around this.