Explorar o código

Merge pull request #463 from imagin/master

[Loggable] Fix bad behaviour of logging 'empty changes'
Gediminas Morkevicius %!s(int64=12) %!d(string=hai) anos
pai
achega
069750c56c
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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);
             }
+            
+            if($action === self::ACTION_UPDATE && 0 === count($newValues)) {
+                return;
+            }
+            
             $version = 1;
             if ($action !== self::ACTION_CREATE) {
                 $version = $ea->getNewVersion($logEntryMeta, $object);