OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

Fix Delete ContentItem Api

Open hyzx86 opened this issue 4 years ago • 5 comments

hyzx86 avatar Mar 28 '22 15:03 hyzx86

I don't think it's a solution to change the current behavior. I would prefer a new API that works on content item version ids, so you can delete a specific version, including drafts.

sebastienros avatar Mar 29 '22 19:03 sebastienros

Hmm, not sure but looks good to me that the API behavior is the same as the mvc controller, this by using VersionOptions.Latest meaning that an item is returned if any active version exists, and if so delete all active versions. In fact this is what we already do but only if a published version exists, in that case we already delete all active versions, if a draft also exists it is also deleted.

jtkech avatar Mar 29 '22 21:03 jtkech

But, I think @sebastienros is right. Because you may want to remove a specific draft with a ContentItemVersionId instead. Else, this will only remove the latest ContentItem whether it is a draft or a published content item.

Skrypt avatar Mar 30 '22 00:03 Skrypt

Else, this will only remove the latest ContentItem whether it is a draft or a published content item.

No, it soft removes all active versions, published and latest if both exist

jtkech avatar Sep 08 '22 15:09 jtkech

Ok with breaking changes but then only if we complete the API such that it's consistent and there is a way to do what was done before.

sebastienros avatar Sep 08 '22 18:09 sebastienros

Do you want to get back to this, @hyzx86?

Piedone avatar Mar 13 '24 18:03 Piedone

This pull request has merge conflicts. Please resolve those before requesting a review.

github-actions[bot] avatar Mar 23 '24 21:03 github-actions[bot]

Close this PR for now, we should provide a new api to remove the specified version

hyzx86 avatar Mar 24 '24 14:03 hyzx86