Skip to content

Commit 4a7328e

Browse files
committed
Merge branch 'release/0.2.2'
2 parents af53ade + fd21c52 commit 4a7328e

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
## [0.2.2] - 2025-02-28
12+
13+
- Updated logging messages.
14+
- Checked nested elements when checking for CPR values.
15+
1116
## [0.2.1] - 2025-02-25
1217

1318
- Removed types from class constants.
@@ -63,7 +68,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6368
- First version of the module
6469
- Added submodule to log user CUD events.
6570

66-
[Unreleased]: https://github.com/OS2web/os2web_audit/compare/0.2.1...HEAD
71+
[Unreleased]: https://github.com/OS2web/os2web_audit/compare/0.2.2...HEAD
72+
[0.2.2]: https://github.com/OS2web/os2web_audit/compare/0.2.1...0.2.2
6773
[0.2.1]: https://github.com/OS2web/os2web_audit/compare/0.2.0...0.2.1
6874
[0.2.0]: https://github.com/OS2web/os2web_audit/compare/0.1.6...0.2.0
6975
[0.1.6]: https://github.com/OS2web/os2web_audit/compare/0.1.5...0.1.6

modules/os2web_audit_entity/os2web_audit_entity.module

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ use Drupal\os2web_audit_entity\Form\SettingsForm;
1313
* Implements hook_entity_insert().
1414
*/
1515
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());
1717
os2web_audit_entity_log($msg);
1818
}
1919

2020
/**
2121
* Implements hook_entity_update().
2222
*/
2323
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());
2525
os2web_audit_entity_log($msg);
2626
}
2727

2828
/**
2929
* Implements hook_entity_delete().
3030
*/
3131
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());
3333
os2web_audit_entity_log($msg);
3434
}
3535

@@ -44,7 +44,7 @@ function os2web_audit_entity_entity_storage_load(mixed $entities, string $entity
4444
/** @var \Drupal\file\Entity\File $entity */
4545
$fid = $entity->id();
4646
$uri = $entity->getFileUri();
47-
$msg = sprintf('File (%d) accessed. Uri "%s"', $fid, $uri);
47+
$msg = sprintf('File (%s) accessed. Uri "%s"', $fid, $uri);
4848
os2web_audit_entity_log($msg);
4949
}
5050
}
@@ -62,7 +62,7 @@ function os2web_audit_entity_webform_post_load_data(mixed $submissions): void {
6262
// Detect field of type that contains "cpr" in name or where field name
6363
// contains "cpr".
6464
$webform = $submission->getWebform();
65-
$elements = $webform->getElementsDecoded();
65+
$elements = $webform->getElementsDecodedAndFlattened();
6666
foreach ($elements as $fieldName => $element) {
6767
if (str_contains(strtolower($element['#type']), 'cpr') || str_contains(strtolower($fieldName), 'cpr')) {
6868
$filterFields[] = $fieldName;
@@ -82,14 +82,14 @@ function os2web_audit_entity_webform_post_load_data(mixed $submissions): void {
8282
if (preg_match('~(.*)/print/pdf/(.*)|(.*)\d.*/attachment(.*)~', $request->getPathInfo())) {
8383
// We know that a webform submission has been loaded and this is a print
8484
// 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());
8686
os2web_audit_entity_log($msg);
8787

8888
// Exit to prevent double log entry.
8989
return;
9090
}
9191

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());
9393
os2web_audit_entity_log($msg);
9494
}
9595
}

0 commit comments

Comments
 (0)