Skip to content
Snippets Groups Projects
Commit c03703c9 authored by Odai Atieh's avatar Odai Atieh Committed by Rajab Natshah
Browse files

Issue #3314358 by Odai Atieh: Add support for node translation changes in Admin Audit Trail Node

parent d92de0a0
No related branches found
No related tags found
No related merge requests found
......@@ -67,3 +67,37 @@ function admin_audit_trail_node_delete($node) {
];
admin_audit_trail_insert($log);
}
/**
* Implements hook_entity_translation_insert().
*/
function admin_audit_trail_node_translation_insert($node) {
$log = [
'type' => 'node',
'operation' => 'translation insert',
'description' => t('%type: %title', [
'%type' => $node->getType(),
'%title' => $node->getTitle(),
]),
'ref_numeric' => $node->id(),
'ref_char' => $node->getTitle(),
];
admin_audit_trail_insert($log);
}
/**
* Implements hook_entity_translation_delete().
*/
function admin_audit_trail_node_translation_delete($node) {
$log = [
'type' => 'node',
'operation' => 'translation delete',
'description' => t('%type: %title', [
'%type' => $node->getType(),
'%title' => $node->getTitle(),
]),
'ref_numeric' => $node->id(),
'ref_char' => $node->getTitle(),
];
admin_audit_trail_insert($log);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment