diff --git a/src/Model/Behavior/AuditLogBehavior.php b/src/Model/Behavior/AuditLogBehavior.php index 3eacfe2..f7ef3df 100644 --- a/src/Model/Behavior/AuditLogBehavior.php +++ b/src/Model/Behavior/AuditLogBehavior.php @@ -106,7 +106,7 @@ class AuditLogBehavior extends Behavior $modelTitle = $this->old[$modelTitleField]; } $this->auditLogs()->insert([ - 'action' => $action, + 'request_action' => $action, 'model' => $entity->getSource(), 'model_id' => $id, 'model_title' => $modelTitle, @@ -130,7 +130,7 @@ class AuditLogBehavior extends Behavior } $logEntity = $this->auditLogs()->newEntity([ - 'action' => $entity->getConstant('ACTION_DELETE'), + 'request_action' => $entity->getConstant('ACTION_DELETE'), 'model' => $entity->getSource(), 'model_id' => $this->old->id, 'model_title' => $modelTitle, diff --git a/src/Model/Entity/AuditLog.php b/src/Model/Entity/AuditLog.php index beabeb8..74e2f41 100644 --- a/src/Model/Entity/AuditLog.php +++ b/src/Model/Entity/AuditLog.php @@ -47,9 +47,9 @@ class AuditLog extends AppModel */ public function generateUserFriendlyTitle($auditLog) { - if (in_array($auditLog['action'], [self::ACTION_TAG, self::ACTION_TAG_LOCAL, self::ACTION_REMOVE_TAG, self::ACTION_REMOVE_TAG_LOCAL], true)) { - $attached = ($auditLog['action'] === self::ACTION_TAG || $auditLog['action'] === self::ACTION_TAG_LOCAL); - $local = ($auditLog['action'] === self::ACTION_TAG_LOCAL || $auditLog['action'] === self::ACTION_REMOVE_TAG_LOCAL) ? __('local') : __('global'); + if (in_array($auditLog['request_action'], [self::ACTION_TAG, self::ACTION_TAG_LOCAL, self::ACTION_REMOVE_TAG, self::ACTION_REMOVE_TAG_LOCAL], true)) { + $attached = ($auditLog['request_action'] === self::ACTION_TAG || $auditLog['request_action'] === self::ACTION_TAG_LOCAL); + $local = ($auditLog['request_action'] === self::ACTION_TAG_LOCAL || $auditLog['request_action'] === self::ACTION_REMOVE_TAG_LOCAL) ? __('local') : __('global'); if ($attached) { return __('Attached %s tag "%s" to %s #%s', $local, $auditLog['model_title'], strtolower($auditLog['model']), $auditLog['model_id']); } else {