aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_versions/lib/Listener/FileEventsListener.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_versions/lib/Listener/FileEventsListener.php b/apps/files_versions/lib/Listener/FileEventsListener.php
index b3694459ac6..98dbce17e96 100644
--- a/apps/files_versions/lib/Listener/FileEventsListener.php
+++ b/apps/files_versions/lib/Listener/FileEventsListener.php
@@ -208,8 +208,9 @@ class FileEventsListener implements IEventListener {
return;
}
- if ($writeHookInfo['versionCreated']) {
+ if ($writeHookInfo['versionCreated'] && $node->getMTime() !== $writeHookInfo['previousNode']->getMTime()) {
// If a new version was created, insert a version in the DB for the current content.
+ // Unless both versions have the same mtime.
$versionEntity = new VersionEntity();
$versionEntity->setFileId($node->getId());
$versionEntity->setTimestamp($node->getMTime());
@@ -227,7 +228,7 @@ class FileEventsListener implements IEventListener {
$this->versionsMapper->update($currentVersionEntity);
}
- unset($this->versionsCreated[$node->getId()]);
+ unset($this->writeHookInfo[$node->getId()]);
}
/**