fix: [auditlogs] more monkey fixing the logging errors via CLI

pull/101/head
iglocska 2022-05-17 09:26:23 +02:00
parent 11c9900580
commit a88318c5df
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 11 additions and 0 deletions

View File

@ -104,6 +104,17 @@ class AuditLogsTable extends AppTable
} }
} }
public function afterMarshal(
EventInterface $event,
EntityInterface $entity,
ArrayObject $data,
ArrayObject $options
) {
if ($entity->request_type === null) {
$entity->request_type = self::REQUEST_TYPE_CLI;
}
}
public function beforeSave(EventInterface $event, EntityInterface $entity, ArrayObject $options) public function beforeSave(EventInterface $event, EntityInterface $entity, ArrayObject $options)
{ {
$entity->request_ip = inet_pton($entity->request_ip); $entity->request_ip = inet_pton($entity->request_ip);