Fix bugs found during testing. #330

This commit is contained in:
Korina Cordero 2020-03-06 08:53:45 +00:00
parent eff3dc94ec
commit e305dc4c16

View file

@ -33,13 +33,10 @@ abstract class EntityListener
// get entity name // get entity name
$obj_class = preg_replace('/.*\\\\/', '', get_class($object)); $obj_class = preg_replace('/.*\\\\/', '', get_class($object));
$log_message = $obj_class . ' with id ' . $object->getID() . ' created by ' . $user_id;
// get fields of object // get fields of object
$fields = $object->fieldDump(); $fields = $object->fieldDump();
error_log($log_message . ' with ' . $fields);
$this->writeToLogDB($obj_class, $object->getID(), 'create', $fields, $user_id); $this->writeToLogDB($obj_class, $object->getID(), 'create', $fields, $user_id);
} }
@ -88,7 +85,9 @@ abstract class EntityListener
]; ];
} }
$this->writeToLogDB($obj_class, $updated_entity->getID(), 'update', $field_changes, $user_id); $fields = json_encode($field_changes);
$this->writeToLogDB($obj_class, $updated_entity->getID(), 'update', $fields, $user_id);
} }
// get deleted objects // get deleted objects