Skip Navigation

[Resolved] Cred form issue – relationship select default value [wpv-current-user]

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
- 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 6 replies, has 2 voices.

Last updated by TomW5440 3 months, 3 weeks ago.

Assigned support staff: Minesh.

Author
Posts
#2430269
tool1.png

Tell us what you are trying to do?
I'm really not sure what's going on here but I have a Cred form that inserts a post. One of it's fields is a relationship select for it's agent (the current user). All I'm trying to do is populate the default value with current user but it's not working at all.

Here's the form shortcode im using in the cred form -
Agent to Property relationship
[cred_field field='@agent-property.parent' value='[wpv-current-user]' class='form-control' output='bootstrap' select_text='--- not set ---' required='false']

Test correct user or author is found -
[wpv-current-user]
[wpv-post-author]
[wpv-user field="display_name"]

#2430917

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

You need to make sure the value you pass should be match to the post ID of agent post. Toolset offers post relationship between post types so current user ID and the post type Agent's post ID should be different that is what I can see should be the issue there.

Can you please share problem URL where you added the form and admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.

#2433497

Minesh
Supporter

Languages: English (English )

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

Thank you for sharing admin access details but can you please share problem URL where you added the form where I can see the parent field you are talking about?

#2433629

Hi Minesh,

It's the New property form - hidden link
This form is then called in the prop count view - hidden link
And prop count view is nested inside Agent property count view - hidden link

Thank you!

#2433631

Minesh
Supporter

Languages: English (English )

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

I do not see anything within the prop-count view loop:
=> hidden link

Can you please tell me what exactly you want? or setup a demo at least so that I can see something on the Agent page:
=> hidden link

#2433651

Hi Minesh,

The reason there is nothing in the prop count is that I only need a[wpv-found-count]. I don't need any data in the loop. The reason the prop count view is nested in agent property count view is so that I can use conditional on the button so if agent cf > [wpv-found-count] the button will display.
I've created an agent for your account so you can see.

Here's how it flows front end -

1) Dashboard where you start. Here you can click create property button - hidden link
2) This takes you to add property where you can see the issue front end. The relationship field agent property parent is not populated by default. - hidden link

So I just want the relationship selects default value to be the current agent. The agent is also the author and the logged in user.

#2433653

My issue is resolved now. Thank you!
The issue was that I wasn't using child post link from parent post, instead I linked to the post which contained the form. It looks like it's working now.