@@ -13,23 +13,23 @@ use Drupal\os2web_audit_entity\Form\SettingsForm;
13
13
* Implements hook_entity_insert().
14
14
*/
15
15
function os2web_audit_entity_entity_insert(EntityInterface $entity): void {
16
- $msg = sprintf('Entity (%d ) of type "%s" created.', $entity->id(), $entity->getEntityTypeId());
16
+ $msg = sprintf('Entity (%s ) of type "%s" created.', $entity->id(), $entity->getEntityTypeId());
17
17
os2web_audit_entity_log($msg);
18
18
}
19
19
20
20
/**
21
21
* Implements hook_entity_update().
22
22
*/
23
23
function os2web_audit_entity_entity_update(EntityInterface $entity): void {
24
- $msg = sprintf('Entity (%d ) of type "%s" updated.', $entity->id(), $entity->getEntityTypeId());
24
+ $msg = sprintf('Entity (%s ) of type "%s" updated.', $entity->id(), $entity->getEntityTypeId());
25
25
os2web_audit_entity_log($msg);
26
26
}
27
27
28
28
/**
29
29
* Implements hook_entity_delete().
30
30
*/
31
31
function os2web_audit_entity_entity_delete(EntityInterface $entity): void {
32
- $msg = sprintf('Entity (%d ) of type "%s" deleted.', $entity->id(), $entity->getEntityTypeId());
32
+ $msg = sprintf('Entity (%s ) of type "%s" deleted.', $entity->id(), $entity->getEntityTypeId());
33
33
os2web_audit_entity_log($msg);
34
34
}
35
35
@@ -44,7 +44,7 @@ function os2web_audit_entity_entity_storage_load(mixed $entities, string $entity
44
44
/** @var \Drupal\file\Entity\File $entity */
45
45
$fid = $entity->id();
46
46
$uri = $entity->getFileUri();
47
- $msg = sprintf('File (%d ) accessed. Uri "%s"', $fid, $uri);
47
+ $msg = sprintf('File (%s ) accessed. Uri "%s"', $fid, $uri);
48
48
os2web_audit_entity_log($msg);
49
49
}
50
50
}
@@ -62,7 +62,7 @@ function os2web_audit_entity_webform_post_load_data(mixed $submissions): void {
62
62
// Detect field of type that contains "cpr" in name or where field name
63
63
// contains "cpr".
64
64
$webform = $submission->getWebform();
65
- $elements = $webform->getElementsDecoded ();
65
+ $elements = $webform->getElementsDecodedAndFlattened ();
66
66
foreach ($elements as $fieldName => $element) {
67
67
if (str_contains(strtolower($element['#type']), 'cpr') || str_contains(strtolower($fieldName), 'cpr')) {
68
68
$filterFields[] = $fieldName;
@@ -82,14 +82,14 @@ function os2web_audit_entity_webform_post_load_data(mixed $submissions): void {
82
82
if (preg_match('~(.*)/print/pdf/(.*)|(.*)\d.*/attachment(.*)~', $request->getPathInfo())) {
83
83
// We know that a webform submission has been loaded and this is a print
84
84
// pdf path. This indicates that this is an attachment download action.
85
- $msg = sprintf('Webform submission (%d ) downloaded as attachment.%s Webform id "%s".', $submission->id(), $personal, $submission->getWebform()->id());
85
+ $msg = sprintf('Webform submission (%s ) downloaded as attachment.%s Webform id "%s".', $submission->id(), $personal, $submission->getWebform()->id());
86
86
os2web_audit_entity_log($msg);
87
87
88
88
// Exit to prevent double log entry.
89
89
return;
90
90
}
91
91
92
- $msg = sprintf('Webform submission (%d ) looked up.%s Webform id "%s".', $submission->id(), $personal, $submission->getWebform()->id());
92
+ $msg = sprintf('Webform submission (%s ) looked up.%s Webform id "%s".', $submission->id(), $personal, $submission->getWebform()->id());
93
93
os2web_audit_entity_log($msg);
94
94
}
95
95
}
0 commit comments