Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

'Undo' of trash/uncurate action does not work #30

Open
AaronHolbrook opened this issue Jan 26, 2016 · 4 comments
Open

'Undo' of trash/uncurate action does not work #30

AaronHolbrook opened this issue Jan 26, 2016 · 4 comments
Assignees
Labels

Comments

@AaronHolbrook
Copy link
Contributor

http://d.pr/i/1huTV/MjwUmXiL

@ayebare this would complement the work you just did with re-labeling trash to uncurate nicely. Mind taking a look?

@ayebare ayebare self-assigned this Jan 26, 2016
@ayebare
Copy link

ayebare commented Jan 26, 2016

Thanks, will do @AaronHolbrook

@ayebare
Copy link

ayebare commented Jan 27, 2016

@AaronHolbrook Currently the curated post is deleted when a post is put in trash. I suggest changes below to have trashing fixed. This is the proposed relationship between the original post and curated post for each action.

Action: Uncurate original post

  • Put the curated post in trash

Action: Curate post

  • Check if the post has a curated counter part in trash using | function is_curated( $post = 0 )
  • If it does, remove the curated post from trash. Else carry out a new curation.

Action: Trash curated post.

  • Uncurate orginal post but don't delete original post curation meta data.

Action : Trash original post.

  • Trash curated post.

Action: Untrash original post

  • Untrash curated post if the post is curated.

Action: Untrash Original post

  • Untrash curated post.

Action: Untrash Curated post

  • Curate original post.
  • We'll aslo need a function to check if the curated post is in trash. This will often be used alongside the is_curated function especially
    for the views e.g edit post view.

Please let me know if I could have missed something fundamental.

@AaronHolbrook
Copy link
Contributor Author

@ayebare I like that you broke out each action possible.

I think we can do this without having a real 'trash' for curated posts but instead rely on the originating post's meta store. FYI I believe 'trash' is disabled for the cur-curator post type

Action: Uncurate Original post

  • simply uncurate fully, as this would not lead to any prompt to 'undo' anything

Action: Curate post

  • check post's meta for trashed status, change status to live; create new curated post

Action: Trash curated post

  • Uncurate original post, don't delete post curation meta data; but set curation status to: trash

Action: Trash original post

  • Trash original post, uncurate, set curated status to original:trashed

Action: Untrash original post

  • Untrash curated post if status was set to original:trashed (i.e. the post was curated at the time of trashing)

Action: Untrash curated post

  • Curate original post, set status meta of original post to curated

@ayebare
Copy link

ayebare commented Feb 4, 2016

Created a PR for the fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants