Co-Authors-Plus icon indicating copy to clipboard operation
Co-Authors-Plus copied to clipboard

Fix #215 "Cannot remove the last author once post is saved"

Open paulschreiber opened this issue 11 years ago • 7 comments

Problem: "If you assign a co-author to a post, save it, and reload the page, the Remove link disappears. You can no longer remove that author."

Fix: Remove the comment // Hide the delete button if there's only one co-author and the two lines of code that follow. The lines in question hide the "X" button. Removing those lines means the X button stays, allowing users to remove the last author.

paulschreiber avatar Nov 20 '14 18:11 paulschreiber

Makes sense to me. @danielbachhuber can you think of any reason not to do this? It seems like it's being hidden on purpose, but I'm not 100% sure why.

joshbetz avatar Dec 17 '14 01:12 joshbetz

There's some existing functionality where you can force the use of guest authors, and default to no assigned author. I don't recall why this wasn't implemented for just straight WordPress authors, although it seems like it could cause problems with caps.

Paul, could you describe in a bit more detail what you want to do to provide context?

Personally, I think CAP really, really needs unit test coverage before we'd go about changing something like this. The codebase is quite old with lots of people using it, so changes make me nervous.

danielbachhuber avatar Dec 17 '14 04:12 danielbachhuber

We sometimes want an article without a CoAuthor. You can create one if your WP user account is not linked to a CoAuthor.

However, if your WP user account is linked to a CoAuthor, then a CoAuthor is automatically assigned to the article, and there's no way to remove that CoAuthor.

This means sometimes staff have to ask someone else to create articles on their behalf, which is inconvenient.

This patch allows you to remove all CoAuthors from an article.

paulschreiber avatar Dec 23 '14 19:12 paulschreiber

@danielbachhuber @joshbetz Can we include this fix? I received another request for it today.

paulschreiber avatar Mar 11 '15 21:03 paulschreiber

I think @danielbachhuber is right that it probably needs a unit test for this first. This particular update also enables this feature for sites that may want it to continue to work as it does now. It would make more sense to me to do it as a filterable option.

bcampeau avatar Mar 11 '15 21:03 bcampeau

A filterable option sounds good. In any case, I think the delete button should still be hidden if there are no coauthors.

joshbetz avatar Mar 11 '15 21:03 joshbetz

@paulschreiber This script needs to be localized with the value of force_guest_authors and then this check can be disabled only in the scenario where that is false.

bcampeau avatar Sep 15 '15 17:09 bcampeau

Closing for lack of response.

GaryJones avatar Jul 27 '23 22:07 GaryJones