Skip Navigation

[Resolved] products relationship error

This support ticket is created 3 years, 3 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
- 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 34 replies, has 3 voices.

Last updated by Minesh 3 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2147241

I'm trying to link a CPT to woocommerce products. I've created a 1-N relationship without any issues. But when I try to link product to my CPT, I get following error:

There was a problem creating the related content: These two elements are already associated and the relationship doesn't allow non-distinct associations.

I never get any products listed at relationship box at CPT editor...

hidden link

#2147553

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

That is strange. I will require to check the relationship you created and what posts you already associated with the post type.

*** 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.

#2150581

Minesh
Supporter

Languages: English (English )

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

I see you have a many-2-many post relationship setup between product and support post type.

Did you created that relationship first using one-2-many and later change it to many-2-many?

#2150703

I think I did a mistake in original post. It should be many-to-many relationship. Any support item can be related to any product...

#2151037

Minesh
Supporter

Languages: English (English )

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

Ok but what I'm asking is have you created the one-2-many relationship first and then later you change that relationship to many-2-many?

#2151163

I don't know really. I didn't do it by myself...

#2152651

Minesh
Supporter

Languages: English (English )

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

I just checked with a test site and I do not find such issue.

Can you please tell me with what product I can see the message you shared. I'm checking the following post and I do not see any message with the post relationship box that you shred with your initial post:
=> hidden link

#2152735

Just checked:
- click 'add existing product'
- choose the first product available
- save

and get the error...

#2152741

just checked:
- click 'connect existing product'
- choose the first one
- save

get the error

#2152789

can't get reply to work (

#2152795

Minesh
Supporter

Languages: English (English )

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

I'm not sure whats going on as I just checked with my test site and many-2-mnay relationship works and I can assign multiple posts within post relationship box without any issue. Please check the following screenshot:
=> hidden link

I suggest you should try to create a fresh post relationship and rule out the existing one (if you have not connected any posts yet using the existing many-2-many post relationship) and check if that works for you.

#2154679

- deleted existing relationship
- added a new one (many-2-many products-supports). note that I don't enable 'create intermediate cpt' option
- tried to link product to support and got the same error

#2155339

Hello there! Minesh is not available today. If you don't mind I'll continue with you on this ticket.

Please try to create a new many-to-many relationship between products and supports. It will be created with a unique slug. Activate the option to create the intermediary post type, and you can disable the option to display it on the backend menu.
Then try to connect posts. I am sure this time, it will work. If it does, you can go and delete the old relationships.

Even though you won't need the intermediary post type, for example, to add fields(date, status, anything), the intermediary post is required to assure the M2M links between posts.

If you are still unable to do so, please allow us temporary access to your website to check it closely. We might also need to take a copy of it for further debugging, let us know if that's fine with you?
Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2155371

I've created product - support relationship again (with intermediate cpt), and I still get the same error

#2155453

Well, something odd is happening. I tried to create a new relationship between products and supports, but it seems to be created between only products. Which is not really a supported feature(same CPT relationships). Check this screenshot hidden link

I removed the existing relationships and created another one with a different slug(I assume it was not used before), but I still can't connect some posts, and I am getting the same message.

To better debug this issue, we'll need to take a copy of your website. Can I install a plugin(Duplicator or All In One Migration) to take the copy?