Topic: Prevent double edit from moderators

Hello,

I am looking for an idea to prevent double edit from moderators.
It often happens on my board : a moderator edits a post, another opens the post and edits it, and the first edit is cancelled by the second.

Thank you for your answer.

Re: Prevent double edit from moderators

Use optimistic locking as described in http://doctrine-orm.readthedocs.org/en/ … ic-locking but without doctrine. Just add version column to DB and work with it.

Re: Prevent double edit from moderators

Thank you!

I read your document, but it is pretty difficult.

I understood that I have to add
- a "version" column to punbb_posts
- a <input type="hidden" name="version" value="' . $post->getCurrentVersion() . '" /> into edit.php file

Then I have to verify if version number is the last for the post before validating the edit?

Is that right?

Re: Prevent double edit from moderators

Right.