Browse Source

Merge pull request #463 from imagin/master

[Loggable] Fix bad behaviour of logging 'empty changes'
Gediminas Morkevicius 12 years ago
parent
commit
069750c56c
1 changed files with 5 additions and 0 deletions
  1. 5 0
      lib/Gedmo/Loggable/LoggableListener.php

+ 5 - 0
lib/Gedmo/Loggable/LoggableListener.php

@@ -260,6 +260,11 @@ class LoggableListener extends MappedEventSubscriber
                 }
                 }
                 $logEntry->setData($newValues);
                 $logEntry->setData($newValues);
             }
             }
+            
+            if($action === self::ACTION_UPDATE && 0 === count($newValues)) {
+                return;
+            }
+            
             $version = 1;
             $version = 1;
             if ($action !== self::ACTION_CREATE) {
             if ($action !== self::ACTION_CREATE) {
                 $version = $ea->getNewVersion($logEntryMeta, $object);
                 $version = $ea->getNewVersion($logEntryMeta, $object);