Skip Navigation

[Resolved] Get records where object reference matches

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.

Our next available supporter will start replying to tickets in about 6.63 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by Minesh 4 months, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2706743

I have data where there is an object reference to a member object.
Example: Issues has an object reference Member, to identify it belongs to them. I realize it would probably be better to create a relationship, but what's done is done. Is there a way to get all Issues belonging to Member X? Where Member is an object reference?

#2706766

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - in order to guide you in the right direction I will have to review your actual data structu4re and have to analyze how the things are stored where and what things you want to display where.

Can you please share problem URL where you want to display the results and for what X member you want to retrieve all related issues and where I can find how issues linked to members.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2706777

Hi, no need to do anything other than answer whether it's possible to get records by object reference, and if so, how?

#2706781

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When you say object - how it is stored. Is it custom post type, custom field, taxonomy?

Do you mean you have post type issues and with that you have custom field "Object Reference" that holds the ID of related Member?

#2706787
Untitled-1.jpg

I have a type called Form Technique Issues
on that we have fields
One of those fields is Member which is a Type

I want to get all Form Technique Issues where Post Reference Member is X

#2706810

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - and you want to get it using PHP way or using view?

I want to get all Form Technique Issues where Post Reference Member is X:
====>
From where you will get the value of post reference member - is it while displaying the sing post of Technique Issues post type or while displaying the single post of post type Member?

#2706812
Untitled-1.jpg

I want to get it using a view and the info that I have is the post id of the Member.

I tried to put the field in the Custom field filter Select items with field:
Member is a number equal to URL_PARAM(memberid)

See screenshot

Then I include the view hidden link

I know member id 24315 has over 4 issues

I tried it with passing a param as well, no luck either way, is it possible to reference to the Member Reference field by id?

#2706824

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Post reference field is managed as one-to-many post-relationship.

So, from the "Query Filter" section of your edit view page, you will have to add the filter for "Post relationship or repeatable field groups owner" and select your post reference field's Member relationship and then chose your desired filter method like using URL param or other.

Please check the following screenshot:
- hidden link