Navigation überspringen

[Gelöst] Change CPT relationship from 1 to many to many-to-many

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

The customer wanted to change an existing Toolset relationship from one-to-many to many-to-many so one event could be connected to multiple partners, and wanted to know whether this could break existing relations.

Solution:

The change is possible, but it should be done carefully on a staging site. Existing event-partner connections need to be checked after the change, and any Views, Forms, templates, or custom code depending on the old one-to-many structure may need updates. It was also noted that many-to-many setups may require an intermediary post type when relationship fields are needed.

This support ticket is created vor 2 weeks, 2 days. 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.

Dieses Thema enthält 1 reply, hat 1 Stimme.

Zuletzt aktualisiert von Christopher Amirian vor 2 weeks, 1 day.

Assistiert von: Christopher Amirian.

Author
Artikel
#2862155

I have a client setup with a couple CPT setup and some relationships. The main feature is a list of events created in collaboration with several partners. In origin Each event could only have a single partner but now they would like to change this and have multiple partners collaborate to a single event. The relationship is therefore changing from 1-to-many to many-to-many.

Is it possible or do I run the risk of breaking current relations?

#2862201

Christopher Amirian
Unterstützer

Sprachen: Englisch (English )

Hi,

Welcome to Toolset support:

I would not recommend changing this as you will need to check many possible problems:

- existing Event → Partner connections should be checked after the change
- any Views, Forms, templates, or custom code that depend on the old one-to-many structure may need updating
- many-to-many relationships may use an intermediary post type if you need relationship fields

So I would say it is possible but you need to do it with caution on a staging/copy version of the website and see if it works on your use case.

Thanks.