Make WordPress Core

Opened 16 years ago

Closed 9 years ago

#6405 closed enhancement (fixed)

When deleting users without any links/posts, don't ask to whom they should be reattributed

Reported by: markjaquith's profile markjaquith Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version: 2.7
Component: Users Keywords: has-patch commit
Focuses: Cc:

Description

When deleting a user, it asks to whom their links/posts should be reattributed (or if they should be deleted). We can skip this screen if they don't have any links or posts.

Attachments (8)

users.patch (12.4 KB) - added by rajnikmit 14 years ago.
6405.diff (4.2 KB) - added by wojtek.szkutnik 14 years ago.
users.diff (2.9 KB) - added by benjmay 11 years ago.
6405.2.diff (3.0 KB) - added by benjmay 9 years ago.
Updated to work with changes in 4.3
6405-list-table.png (66.0 KB) - added by wonderboymusic 9 years ago.
6405-has-posts.png (28.6 KB) - added by wonderboymusic 9 years ago.
6405-no-posts.png (15.6 KB) - added by wonderboymusic 9 years ago.
6405.3.diff (3.9 KB) - added by wonderboymusic 9 years ago.

Download all attachments as: .zip

Change History (28)

#1 @mrmist
15 years ago

  • Keywords needs-patch added
  • Version changed from 2.5 to 2.7

#2 @Denis-de-Bernardy
15 years ago

  • Component changed from Administration to Users
  • Milestone changed from 2.9 to Future Release

#3 @rajnikmit
14 years ago

  • Owner changed from anonymous to rajnikmit
  • Status changed from new to accepted

@rajnikmit
14 years ago

#4 in reply to: ↑ description @rajnikmit
14 years ago

  • Keywords has-patch added; needs-patch removed

Hi,
I added a patch.Please check it and let me know.

#5 @nacin
14 years ago

  • Keywords needs-patch added; has-patch removed

Please create a diff against trunk. That patch removes a significant amount of code that was recently committed, and therefore I have no idea what you changed.

Please review your diffs pre/post upload. It would have been rather obvious to realize that you were suggesting so many changes.

#6 @wojtek.szkutnik
14 years ago

  • Cc wojtek.szkutnik@… added
  • Keywords has-patch needs-testing added; needs-patch removed

The previous one seems a little inefficient, this one should do a better job.

#7 @wojtek.szkutnik
14 years ago

  • Keywords gsoc added

#8 @MichaelZed
11 years ago

See also ticket #23224 Delete Users: selecting a username should select the “Attribute all posts to” radio button

#9 @ocean90
11 years ago

#23730 was marked as a duplicate.

#10 @ocean90
11 years ago

  • Keywords needs-refresh added; needs-testing gsoc removed

@benjmay
11 years ago

#11 @benjmay
11 years ago

  • Cc bmay@… added

I put a quick proof of concept together, essentially checking that any of the user(s) about to be deleted have any kind of post, and if they don't, just show a hidden input to run the default delete action on the next step, rather than re-assign.

I also put a check on the jQuery in the header, that if that hidden field exists, it doesn't disable the submit button.

I'm not sure if a text line with words to the effect of "This user has no posts that need to be dealt with" - incase they are expecting those two options.

#12 @sethshoultes
11 years ago

  • Version changed from 2.7 to trunk

I tested the patch, submitted by benjmay, against trunk. I was able to delete a user, that didn't have any posts, without having to attribute (or delete) the non-existent posts to another user. I also tested with a user that had created a post, and was asked to attribute the post created by this user, to another user without issue.

It seems to be working pretty well.

#13 @ocean90
11 years ago

  • Version changed from trunk to 2.7

Version field indicates when the enhancement was initially suggested.

#14 @chriscct7
9 years ago

  • Keywords needs-testing added

@benjmay
9 years ago

Updated to work with changes in 4.3

#15 @benjmay
9 years ago

  • Keywords needs-refresh removed

Thanks @chriscct7

Tested against both a single and multiple user with posts and without posts.

Come copy changes have been introduced since previous patch was submitted.

#16 @chriscct7
9 years ago

  • Keywords needs-refresh added; needs-testing removed
  • Milestone changed from Future Release to 4.4
  • Owner changed from rajnikmit to chriscct7

Looks good. There's a couple formatting issues with the ticket, and a general patch file issue, but I'll take care of them. Thanks for your work on this @benjmay!

#17 @benjmay
9 years ago

Ah, on reflection, I can see the tabbing/spacing is wrong. Thanks for taking care of it @chriscct7 :-)

#18 @chriscct7
9 years ago

Not a problem :)

#19 @wonderboymusic
9 years ago

  • Keywords commit added; needs-refresh removed
  • Owner changed from chriscct7 to wonderboymusic
  • Status changed from accepted to assigned

Added Viz/Recs

In 6405.3.diff:

  • Move the JS function declaration to wp-admin/includes/user.php
  • Rather than changing the JS to not run when there are no posts, don't include it at all if there are no posts

#20 @wonderboymusic
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 34000:

When deleting via User List Table, don't prompt for re-attribution if the user(s) do(es) not have any posts.

Props rajnikmit, wojtek.szkutnik, benjmay, wonderboymusic.
Fixes #6405.

Note: See TracTickets for help on using tickets.