Parcourir la source

Fixing a bad place to set a variable

After this error :
Notice: Undefined variable: newValues in gedmo/doctrine-extensions/lib/Gedmo/Loggable/LoggableListener.php line 264

I'm seeing the var $newValues wasn't set for the next condition.
Wagner Nicolas il y a 12 ans
Parent
commit
7140f83837
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      lib/Gedmo/Loggable/LoggableListener.php

+ 1 - 1
lib/Gedmo/Loggable/LoggableListener.php

@@ -238,8 +238,8 @@ class LoggableListener extends MappedEventSubscriber
             }
             $uow = $om->getUnitOfWork();
             $logEntry->setObjectId($objectId);
+            $newValues = array();
             if ($action !== self::ACTION_REMOVE && isset($config['versioned'])) {
-                $newValues = array();
                 foreach ($ea->getObjectChangeSet($uow, $object) as $field => $changes) {
                     if (!in_array($field, $config['versioned'])) {
                         continue;