Skip Navigation

[Resolved] Delete post relationship not working

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

Last updated by grahamA 6 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1119147

I wish to give the front end user the ability to delete a relationship they have set previously.
I have followed the tutorial however the delete relationship link has no effect

I have tried both one to many and many to many.

Please can you advise

#1119975

Nigel
Supporter

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

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

Screenshot 2018-10-03 at 14.58.24.png

Hi Graham

I just tried this out on a local test site and it worked as expected.

I have "Lefts" and "Rights" connected in a m2m relationship, with several sample connected posts.

In a View inserted on the template for single Left posts that displays connected Rights, I included a link to delete the relationship (as described here: https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/#deleting-existing-connections-between-posts), and that link looked like

[cred-delete-relationship role_items='$fromViews' relationship='left-right' redirect='self']Delete this relationship[/cred-delete-relationship]

When, on the front-end, I clicked the link, it deleted the relationship between Left and Right posts (but didn't delete the posts themselves).

I went onto your site and tested the same—and found the same.

On the Acme Company client page there is a View listing connected Projects, with delete relationship links.

When I first loaded the page the projects 10, 12, 14 and 16 were connected.

I clicked the link to delete the relationship with project 10, and that's exactly what happened (as confirmed in the backend, see screenshot).

Perhaps you are expecting something different?

#1120028

Aha. thank you for the reply Nigel.

I think I have found the issue, unless you are logged in as admin the delete relationship does not work.

I have created a new user as a subscriber or editor (un:tester pw:password) and it does not work. Only if you are logged as administrator.

I need my users as subscriber to be able to delete the relationship.

Any ideas?

Graham

#1120637

Nigel
Supporter

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

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

Subscribers don't have rights to publish/edit/delete posts by default, so you will need to add the Access plugin to the mix and give permissions to subscribers to delete the intermediate post type.

https://toolset.com/documentation/user-guides/setting-access-control/

#1120639

My issue is resolved now. Thank you!
🙂