Skip Navigation

[Resolved] cred-delete-relationship shortcode

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

Last updated by Waqar 8 months, 3 weeks ago.

Assisted by: Waqar.

Author
Posts
#2656995
Toolset_Object Edit Template_2.JPG
Toolset_Object Edit Template_1.JPG
Toolset_Object Display Template.JPG

What are you trying to achieve ?
I have 2 many-to-many relationships : createur-objet and exposition-objet
I also have a single template with the form to Edit an Objet, including (from top to bottom) :
1- a relationship form for connecting the current Object to a Createur
2- a view displaying the image (portrait) and the name of the connected Createur (if any : if not "No items found")
3- a cred-delete-relationship to disconnect the current Object from the connected Createur

4- a relationship form for connecting the current Object to an Exposition
5- a view displaying the title of the connected Exposition (if any : if not "No items found")
6- a cred-delete-relationship to disconnect the current Object from the connected Exposition

7- the form editing the firlds of the current Object

The items 1, 2 and 3 are working well.
The items 4 is working fine but the item 4 does not display anything but "No items found", eventhough the Heading dynamic properties are configured right : this keeps the item 6 from beeing tested

I tried redoing the configuration steps carefully several times, but at no avail.
What am I doing wrong ?

Is there any documentation that you are following?
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred-delete-relationship
https://toolset.com/forums/topic/need-to-have-an-front-end-edit-one-to-many-relationship-form/#post-2365793

Is there a similar example that we can see?
- editing the template : hidden link
- displaying the template for a given Object : hidden link

What is the link to your site?
hidden link

Thank you for helping me with this issue.
Best regards,
Francesco De Grandi

#2657115

Hi Francesco,

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

From the screenshots and your description, the scope of the view should be correctly set to show the related posts.

To troubleshoot this, I'll need to see how this content template is set up in the admin area. Can you please share temporary admin login details, in reply to this message?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2658453

Thank you for sharing the access details.

During troubleshooting, I noticed something strange in your website's relationship setup.

The relationships between the same post types are repeated, which seems to be causing confusion and inconsistency.

For example, a many-to-many relationship 'Créateurs Objets' exists between 'Créateurs' and 'Objets' post types. But another many-to-many relationship 'Objets Créateur-e-s', also exists between these same post types.

Similarly, a many-to-many relationship 'Expositions Objets' exists between 'Fêtes-Expositions-Archives' and 'Objets' post types. But another many-to-many relationship 'Objets Fêtes-Expositions-Lots archives', also exists between these same post types.

My recommendation would be to review all these existing post-relationships and remove the duplicates. Once done, update your content template, views, and forms to use the correct relationships, and then test the elements again.

#2658783

Hi Waqar,
Thank you for your rapid respnse :
- yes, the duplicate relationships were the culprits
- they were generated when, in the custom field group for Objets, I converted some one-to-many relationships reference fields to many-to-many : the reference fields then were no more part of the group, and those 'duplicate relationships' were created in the background :
--- the custom fields group message system should tell the user more explicitely that Toolset will create a many-to-many relationship
--- or rather : Toolset should not re-create a many-to-many relationship which already dos exist
--- ? is it a bug ? or a feature request ?
- and thanks to the option of being able to de-activate them safely, I was able to test the display of the connected items on the editing template

The issue ie therefore resoved.
Best regards,

FRANCESCOD7762 confirmed that the issue was resolved on 2023-10-31 13:18:22.
This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.