Skip Navigation

[Resolved] New Intermediary Posts Do Not Appear In View

This support ticket is created 2 years, 6 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)

Author
Posts
#2407067

I am trying to: Have a view display all posts related through intermediary post type. We have a yearly event. We have a custom post type called "Year" with a post for each event. We have a custom post type called "Invitee" with a post for each person attending. We have an intermediary post type called "Year Registrant" that links the two (one post for each instance of an Invitee attending a Year).

Link to a page where the issue can be seen: This is a private site and I can provide access to a staging copy. I've recorded a Loom video I can provide a link to that demonstrates the issue. I need to provide this through a private link as it contains some private information.

I expected to see: All records that the view calls for through the intermediary post type.

Instead, I got: Only records that are related to Invitee posts that existed prior to the view being created (i.e. they were imported when we migrated from Drupal. If I now create a new Invitee and link it to a Year, it does not show up in the view.

The Debug info below is from the staging site. I will provide access if needed after you've seen the video.

#2407503

Hi,

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

I've set the next reply as private, so that you can share temporary admin login details, along with the loom video link.

Note: I'll also need your permission to download a clone/snapshot of the website, in case this needs to be investigated on a different server.

regards,
Waqar

#2408019

I just realized that the WP Admin account had not been properly created. It is now active. Username is: toolset (not "Toolset"). Same Password I previously sent.

#2408355

Thank you for sharing the access details and the screen recording.

In the custom field group "Field Group for Invitees" for the "Invitees" post type, I see that the last name field is registered with the slug "last-name" ( system slug 'wpcf-last-name' ).

But, there is another custom field with slug "wpcf-invitee-last-name" and for older Invitees posts like "Manoj Nair", the last name is stored in that custom field too.
( screenshot: hidden link )

I suspect that earlier, the website was using the "Last Name" field with the slug "wpcf-invitee-last-name", but it was later changed to "wpcf-last-name".

As the view "Year Attendees Working" is set to order by this old "Last Name" field ( slug: "wpcf-invitee-last-name" ), any Invitees posts where this field is empty, are ignored by the view, which is why the post "New Person" was missing.

To confirm, I've manually added a custom field record "wpcf-invitee-last-name" for this "New Person" invitees and it is now showing on the 2022 year page.

To fix this, you can change the ordering setting of the view to select the other "Last Name" field and it will work for the new posts.

#2408533

Thank you! I was not aware that the slug had been changed and wish it had not. I assume that, if I were to change it back, it would cause complications at this point since there is so much live data?

#2408883

Yes, your understanding is correct and the change in slug makes the situation slightly complicated.

Here is how I would deal with it:

1. Make a full backup copy of the website.

2. As in the Toolset's custom field group the new field slug is "last-name", I'd stick with the new one (i.e. 'wpcf-last-name')

3. For all posts where the custom field key 'wpcf-invitee-last-name' is in use, I'd change it to 'wpcf-last-name', either through the phpMyAdmin database tool or through custom PHP code.

For more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/