XWIKI-8157: The "Copy Page" action adds an extra version to the attached file
* Reset the dirty flags on attachments to prevent the store from incrementing their version.
XWIKI-8157: The "Copy Page" action adds an extra version to the attached file
* Fix some deprecated method calls.
* Add unit test (use a separate test class because I don't have time right now to move XWikiTest to Mockito).