Skip Navigation

[Resolved] View unable to display custom fields in intermediary posts

This support ticket is created 5 years, 9 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 9 replies, has 2 voices.

Last updated by Nigel 5 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#1234363
toolset view issue.jpg

I am trying to: display the custom fields of the intermediary posts in a view

Link to a page where the issue can be seen:
hidden link
hidden link
The english and indonesian example should be shown.

I expected to see: fields shown with the examples as per backend (image uploaded)

Instead, I got: the fields are empty

#1234423

Nigel
Supporter

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

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

Screenshot 2019-04-23 at 13.56.33.png

Hi Bernice

You have a relationship between two posts of the left and right side of a relationship.

Let's say your starting point is the left side, e.g. you are displaying a single 'left' post, and you want to display the connected right posts and the relationship fields for each connection.

So you create a View that queries posts from the other side of the relationship, with a relationship Query Filter to specify posts related to the current post. Then in the Loop Output section you output fields from the right side post type directly, and you can output the relationship fields by using the "Post selection" tab when inserting fields with the Fields and Views button, as shown in the screenshot.

When the shortcodes for the fields are inserted they will then have an item attribute which specifies the post the field values should come from (in this case the intermediate post), e.g.

[types field='digits' item='@left-right.intermediary'][/types]

Does that make sense?

#1236875

Hi Nigel, Thanks for this. This is exactly, what i had, but the issue is that it doesn't appear.
If i am not mistaken, it was appearing before. but it isn't.
[types field='english-example' item='@english-indonesian.intermediary'][/types]
[types field='indonesian-example' item='@english-indonesian.intermediary'][/types]

#1236977

Nigel
Supporter

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

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

I've tried unsuccessfully to recreate the problem locally with a set-up that is very similar to on your site.

So I've taken a copy of your site and I'll do some more tests. If I can't identify the problem I'll need to pass it to my colleagues, but I'll let you know what I find first.

#1236993

Nigel
Supporter

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

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

I was able to identify that the problem arises with WYSIWYG fields as relationship fields, which I was able to reproduce on my own test site.

If you use simple fields, such as a single line text field, then the fields output correctly as expected.

I've escalated this to my second-tier colleagues, and I'll get back to you when they have some feedback.

#1237499

Thanks Nigel for figuring that out. Please do send me an update once you have spoken with your other colleagues.

#1237503

Hi Nigel,
I tried it again by adding a new custom field using the single line text field. However, i am still unable to populate the fields.

#1237715

Nigel
Supporter

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

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

I can't see why not, so I've passed a copy of your site to my colleague in second tier for further debugging.

I'll let you know when I have some feedback.

#1238952

Hi Nigel, thanks, please do let me know when you receive the feedback.

Thank you.

#1246380

Nigel
Supporter

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

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

This got escalated to the developers as it wasn't possible to pin point the underlying cause, and they have been working through the database tables to see what is stored there, and what they found surprised them.

As well as data for the relationship we see in the backend UI, English [*] << English Indonesian >> Indonesian [*], the database also contains entries from a reverse relationship (Indonesian on the left, English on the right) and multiple entries for the same connection (which is currently not supported and cannot be added using the UI), and there are many such examples, including records of connections between posts which no longer exist.

Can we get more information about how the site has evolved? It appears that you may have been testing different versions of the relationships, adding and removing content, possibly importing data, before arriving at the position you are in now. Would that be right? Because it doesn't seem possible that what you have in the database now could be generated by the current version of your site.

It may require some manual intervention to tidy up the database, but please let me know more about the history of the site first.