Skip Navigation

[Resolved] post relationship display trash posts in backend

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

Last updated by Max 5 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#1205350

Max
problem2.png
problem1.png

I trashed post with types relationsheep (one-to-many). This post is still displayed in the relationship area in the backend, when editing. Is this normal behavior? Tested on hidden link too.

#1205488

Yvette Oliveau
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Pacific/Niue (GMT-11:00)

Hello.

Yes. This is expected behaviour.

"Trash"ing a post is not the same as deleting it from the system. The relationship will/should be cleared of this post.id when the post is "permenantly deleted" from the system.

Does this answer your question?

#1206750

Max
trash.png

Hello.
Sorry, but I disagree. I understand that deleting a post is not emptying the trash. But when I delete a post, I guess that it gets into the trash, and the link with the related post is disconnected. If I want to untrash the post - the connection should be restored as well.

Now it does not make sense.
1. I send the related post to the trash.
2. I still see the deleted post in the relationship field in backend.
3. I click "edit". WordPress says - you can not edit the post, because it is in the trash".
This introduces a misunderstanding for the site administrator.
This is unexpected behaviour.

#1207069

Nigel
Supporter

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

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

Hi Max

I found different behaviour depending on from where I sent the related post to the trash.

When editing a parent post where I can see the connected child posts, I can trash the child directly from there, and I would say in that case that the behaviour is entirely as intended and expected.

I get a warning that the operation cannot be undone, and a message to confirm both that the post has been trashed and that the association has been deleted.

The problem is when you trash the post independently of the parent post.

If I go to the admin page to list the child posts and trash the post directly from there then I see what you describe.

I can go back to edit the parent post and the child post still looks connected, but I cannot follow the edit link (to either delete it permanently or restore it) because it is already in the trash.

I'll report this to the developers. It seems like we should use the wp_trash_post hook to enforce the same behaviour, or—at least—not show trashed posts in the list of related posts.

I'll report back with their feedback.

#1228464

Nigel
Supporter

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

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

Hi Max

Just a quick update to report that there is a fix for the above, which will be included in Types 3.3.

That still has to go through QA testing, right now I would expect it in a week or two.

#1228519

Max

Hi Nigel
Thank you!

#1240851

Nigel
Supporter

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

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

Hi Max

Just to let you know that Types 3.3 is finally out if you want to update (after backing up) and re-test, thanks.

#1249797

Max

My issue is resolved now. Thank you!