Skip Navigation

[Resolved] Relationship drops i am on some forms not working

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
- 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 5 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1221029

Apologies typo in title should read dropdown

I am trying to: enter the relationship of one CPT with another on a content creation form

I expected to see: a searchable box

Instead, I got: a dropdown where the only option is "-----Not set-----"

This,affects some but not all of my forms.

#1221373

Hi Nick,

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

The list of custom post types in the relationship fields can be empty in a case when there aren't any posts which are eligible to be linked to the new content being created.

Have you checked the source CPT if such posts exist and they're still not showing in the form?

In case the issue still persists, you're welcome to share temporary admin access details, along with the information about the form with this issue.

I've set your next reply as private and please make a complete backup copy of the website, before sharing the access information.

regards,
Waqar

#1223326

Thanks. I have worked out what the problem is, and I would say this is a "bug".

The relationship slug in this case was set (probably by me) as supporter-campaign. It looks like hyphen is not an allowed character. When I changed the slug to supporter_campaign and recreated the form with this slug to show the field, it was fine.

Use of hyphen in slugs probably ought to be caught at the input stage and rejected

#1223939

Hi Nick,

Thanks for sharing the update.

By default, the relationship slug uses the hyphen ( - ) to connect the names of the connected posts and I couldn't reproduce this issue on my test website.
( screenshot: hidden link )

If you could share more specific steps and/or screenshot on how to reproduce this, I'll be in a better position to test and report it, accordingly.

regards,
Waqar

#1224862
relationships.png

Hi Waqar

Thanks

It seems that all of the migrated post relationships on my site use underscore and all new ones since migration use hyphens. The others using hyphens all work, but not supporter-campaign, until I changed the slug to supporter_campaign and changed the references in forms and view.

Maybe something in the editing of the relationship fixed something else and it is unrelated to the use of underscore itself?

Regardless of what I used, the relationship worked fine in the backend but not in Toolset Forms

I believe my issue is now resolved but I worry about the next relationship I create!

Here is a screenshot of my relationships

#1224868

UPDATE - This also affects another relationship (supporter-show) which I have had to rename to supporter_show

#1225099

Hi Nick,

Thanks for writing back.

The migrated relationships used underscore to form a slug, so this explains the difference in the slug structure.
( ref: https://toolset.com/2018/05/when-if-to-migrate-relationships-in-old-toolset-sites/ )

To make sure that any newly formed relationships are not affected, you can create two temporary/dummy post types and connect them using a new relationship.

After that, you can test if the slug for this new post-relationship works as expected, in the admin area, views, and forms, etc.

Please let me know if you still find something out-of-place.

regards,
Waqar