Skip Navigation

[Resolved] No relationship field even though I created many to many relationship.

This support ticket is created 6 years, 4 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 14 replies, has 2 voices.

Last updated by Nigel 6 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#1094565

There is no option to add the relationship field on CRED form even though I created a many to many relationship based on coupons post type. see this screenshot hidden link

This is the many to many relationship I created see this screenshot hidden link

#1094678

Nigel
Supporter

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

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

Hi Tim

You are right, there is no such option—currently.

You need to use a Relationship Form rather than the standard post form, as described here: https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

It's not a great workflow, but was the first implementation of being able to add related posts (and fields) from the front end.

On the back end you'll notice that you have to save a post before you can start adding/connecting related posts and filling the relationship fields.

On the front-end when you have a post form, the post isn't created yet to be able to add related posts and relationship fields.

It's possible, of course, to produce a technical solution to improve this, and the next dev cycle for Toolset Forms is currently being discussed. I've been pushing to include this in the next round of work, and so your question is timely, I will add it to the voices on this topic.

#1094700

Is it possible I can just use the options of Relationship field on the Standard form using many to many relationship?

#1094709

Everytime I connect to the relationship it doesn't work I always have an error saying like this hidden link

#1094891

Nigel
Supporter

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

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

Hi Tim

A relationship field doesn't belong to either of the posts that are connected with the M2M relationship (an intermediate post is created specifically to hold the relationship custom fields). A post form can only include fields of the post being created, so it is not possible to include relationship fields on a normal post form, you need to use a relationship form for that, and this is one of the things which will be improved in a Forms update (hopefully the next development cycle).

Regarding the error you are seeing, that's unexpected.

Before going any further, can I ask you to try temporarily disabling all non-Toolset plugins and switching to the twentyseventeen theme and checking whether you still see the warning? If not, it should be possible to determine where a conflict comes from by a process of elimination.

Let me know what you find.

#1094924

Ok, one more question what is the compatible PHP version of the toolset plugin?

#1095011

Nigel
Supporter

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

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

You need PHP 5.3 or above, though at least 5.6 is recommended.

https://toolset.com/toolset-requirements/

#1095653

I don't understand I created a one to many relationship of Coupon that will connect to many Directory Listings. But still the relationship field on the Standard Form still doesn't have the option to add it. see this recording hidden link

#1095705

Nigel
Supporter

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

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

Hi Tim

That video whizzed past, I wasn't sure what I was supposed to see.

A one-to-many relationship doesn't have relationship fields (which are a many-to-many concept).

If Coupon is the parent and Directory Listings the child, coupons have fields and listings have fields.

A form to publish coupons can contain coupon fields.

A form to publish listings can contain listing fields.

In this case the one special field would be that a form to publish child listings can (should) include a field to set the parent coupon to which they belong. (It will be added automatically if you auto-generate a form to publish child posts.)

That is described here: https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/

If you mean something else, could you clarify?

#1095720

About the error see this recording hidden link I always encounter this every time I submit a form based on the relationship field. I already deactivated all the plugins which are not related to Toolset plugins and set the default Theme. But still I am having this error do you think the issue is my PHP version because it is not recommended my PHP version is 7.1. Or maybe something else.

#1095943

Nigel
Supporter

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

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

Hi Tim

I'm taking a copy of your site so I can take a closer look to see if I can identify the source of the error message.

I'll get back to you.

#1095971

Nigel
Supporter

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

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

Hi Tim

I installed the site locally and I don't see the debug errors (although I did see a couple of unrelated PHP notices which you may want to investigate).

The debug info I have for your server says PHP version 7.0.31, not 7.1.

Which is correct?

#1096460

Did you duplicate the site? When you install the site locally did you still see this error hidden link
Yes, the Php version is somewhere 7 and up.

#1096741

I'm running PHP version: 7.0.31. Could that be causing the issue?

#1096888

Nigel
Supporter

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

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

I don't think so. I don't have that exact same version available in my local dev environment, but I tried PHP 7 versions before and after that one and have the same result, namely that it works without error.

Do you have a staging or development server available?

I suggest you create a fresh WordPress install on a new server, and then export your site to that server using All in One WP Migration. (I see you have it installed already, that's why I used to take a copy of your site.)

Re-test the issue to see if the PHP errors disappear.

Given my experience I expect they will.

If that is the case then on your production server you could go to Dashboard > Updates and force re-install WordPress, then import the same archive that you successfully used to create the development server.

If you are able to try that let me know how you get on.