Skip Navigation

[Resolved] Edit/Remove connection not working as expected

This support ticket is created 5 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
- 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 10 replies, has 2 voices.

Last updated by duongN-3 5 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1357617

Tell us what you are trying to do?
Adding Edit and Remove function to edit/remove a Person to a Drama title.
Remove function just reloads the page and doesn't do anything.
Edit function throws this error: The items in the conection are not actually connected

Is there any documentation that you are following?
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/

Is there a similar example that we can see?
hidden link

What is the link to your site?
hidden link

#1357875

Hi,

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

To troubleshoot why the edit/remove form is not working as expected, I'll need to see how this form and the post-relationship 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 though no changes will be made on your website, please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1359625

Hi,

Thank you for sharing the admin access and the additional details.

Unfortunately, the username and/or password that you've shared is not being accepted with "Please re-check login info." error message.

Can you please check the username and password again and also make sure that there are no additional security restrictions enabled?

Your next reply will be private too.

regards,
Waqar

#1361087

Hi,

I managed to log in using the new password, thank you.

I noticed the Relationship forms screen ( WP Admin -> Toolset -> Relationship Forms ) is not accessible on your website and shows the following message:

"The site is experiencing technical difficulties. Please check your site admin email inbox for instructions."

To troubleshoot this, I'll recommend the following steps:

1. Please make sure all plugins and the active theme on the website are updated to their latest versions. Currently, there are a number of plugins on your website, for which a newer version is available, which also includes Toolset Access and Forms.

2. In case the issue still persists after updating all plugins, you can turn on WordPress debugging ( ref: https://wordpress.org/support/article/debugging-in-wordpress/ ) and check for any additional errors or warnings on the screen or in the server's error logs.

I hope this helps and let me know how it goes.

regards,
Waqar

#1361127

Hi Waqar,

I've already updated Access and Forms and Relationship Forms is now showing.
Can you check again?

Thanks.

#1361211

Hi,

I've checked your content template for editing the "Cast Drama" relationship ( hidden link ) and noticed that it has this shortcode for the form:


[cred-relationship-form form='edit-drama-cast']

Please update it to the following, so that it can auto-populate the current drama in the drama field:


[cred-relationship-form form='edit-drama-cast' parent_item='$current']

After that when you'll check the edit link for this template, you'll see that the form will show, correctly.
Example: hidden link

After that, you can include the edit form link in your drama content template as needed.

Additional note: I've noticed that you're not using any Layouts from the Toolset Layouts plugin on the website, but it is still active. It will be better to deactivate the plugin, to avoid any confusion during adding the edit post forms and links. With Toolset Layouts plugin disabled, you'll be asked to select an editing content template and not layout, while adding edit form links.

I hope this helps and please let me know how it goes.

regards,
Waqar

#1361471

Thanks Waqar!
I've added parent_item='$current' and now the form shows correctly while adding a cast member!

I'm now trying to add the "delete relationship" link, but that isn't working as expected.
The code in my loop item in the view "List of Drama Credits" is as below (link: hidden link):

[cred-delete-relationship role_items='$fromViews' relationship='cast' parent_item='$current' redirect='self' message='Are you sure you want to delete this?' message_show='1' class='cred-refresh-after-delete']<i class="fas fa-minus-circle"></i> Remove Cast[/cred-delete-relationship]

This doesn't do anything. I'd also like a prompt asking the user if they want to delete the relationship.

I've disabled Layouts from Toolset as you've suggested. Are there any advantages to using it? I feel comfortable using HTML/CSS which is why I'm not using it.

Thanks for all your help so far!

#1361999

Hi,

Thanks for the update and glad that the relationship editing form is working now.

The view "List of Drama Credits" is set to show "Cast Intermediary Posts" posts and the shortcode to delete the relationship ( [cred-delete-relationship] ) will only work from a view that is set to show either the "Drama" or the "Cast" posts.
( the actual parent and child post types in the relationship ).

Moreover, the "cred-delete-relationship" shortcode doesn't support the confirmation prompt feature.

A better way to achieve this is to replace this "cred-delete-relationship" shortcode with the regular post delete shortcode "cred_delete_post_link":
( ref: https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_delete_post_link )

Example:


[cred_delete_post_link action='delete' message_after='Post deleted' message='Are you sure you want to delete this post?' message_show='1' class='cred-refresh-after-delete']Delete %TITLE%[/cred_delete_post_link]

This shortcode will actually work in the view "List of Drama Credits" and it also supports the confirmation prompt feature.

When the Intermediary post for the relationship will be deleted, the relevant relationship between that drama and the cast will also be deleted, automatically.

regards,
Waqar

#1362285

Thank you so much Waqar!
I've learned so much from you so far, but I have one last request.

What's the best way to add an "edit" link/shortcode to edit the Drama-Cast relationship in the "List of Drama Credits" view?

Thank you again.

#1362699

Hi,

I noticed that when the "cred-relationship-form-link" shortcode is placed in the "List of Drama Credits" view, it shows the same message "The items in the conection are not actually connected", as you originally reported.

As this shortcode is designed to work within the scope of the view of the participating parent (Dramas) or child (People) posts of the relationship, here are steps that I took:

1. I created a new post view "View to show an edit link for the Cast-Dramas" and set it to show only those "People" posts, which are related to the current post in the view.

2. In the content of this view, I only included the "cred-relationship-form-link" shortcode:


[cred-relationship-form-link form='edit-drama-cast' role_items='$fromViews' content_template_slug='editing-cast-drama']Edit[/cred-relationship-form-link]

3. After that. I placed the shortcode of this view into the content template of the view "List of Drama Credits" and it is working, as expected on the single drama pages.

regards,
Waqar

#1364591

My issue is resolved now. Thank you!