gitium icon indicating copy to clipboard operation
gitium copied to clipboard

Leaving the WordPress editor open can overwrite other people's commits

Open dragostis opened this issue 10 years ago • 3 comments

When someone pushes changes while someone's editor is open, he won't see them, so when he saves from the editor, the changes that the other person did will be lost.

I see three solutions to this:

  • doing a git pull --rebase when hitting the save button and then pushing the changes (any merge conflicts should be solved by keeping what's in the editor)
  • a better solution would be to constantly update the file in the editor with git pull --rebase
  • the best solution would be to have a JavaScript file that constantly tries to see if you're behind and, if you are, it should ask you if you want to do a git pull --rebase and show the newer version

dragostis avatar Apr 08 '15 10:04 dragostis

Following the discussions with you, the best solution for this is to implement the 'take over' feature from post editor. This feature appears when more than one editor is editing the same post.

Marius786 avatar Apr 08 '15 10:04 Marius786

This could be a great addition to the WP core -> "Take over" for theme/plugin editing.

However this doesn't solve the issue when somebody else pushes changes through SFTP and/or using Git commands and you overwrite that code.

pdobrescu avatar Apr 08 '15 11:04 pdobrescu

Can be done using wp_set_post_lock 'take over' and heartbeat to check for external changes

hubdotcom avatar May 25 '16 19:05 hubdotcom