Browse Source

D10 support.

pull/10/head
Adam Vessey 1 year ago
parent
commit
754503259c
No known key found for this signature in database
GPG Key ID: 89B39535BF6D0D39
  1. 8
      README.md
  2. 2
      dgi_fixity.info.yml
  3. 1
      src/Controller/FixityCheckController.php
  4. 4
      src/FixityCheckService.php

8
README.md

@ -6,10 +6,10 @@ Perform periodic fixity checks on selected files.
This module defines a new content entity type `fixity_check`. This entity is
used as an audit trail for fixity checks performed on a related `file` entity.
Wherein the revisions of the `fixity_check` record the results of previous
Wherein the revisions of the `fixity_check` record the results of previous
checks against that `file` entity.
This modules requires and enforces the following constraints on `fixity_check`
This modules requires and enforces the following constraints on `fixity_check`
entities:
- **Must** be related to a `file`
@ -29,7 +29,7 @@ Users with the permission `View Fixity Checks` can:
- View fixity audit log of Media entities
A `cron` hook is setup to automatically mark files as _requiring_ periodic
checks. As well as performing those checks on a regular basis. Email
checks. As well as performing those checks on a regular basis. Email
notifications can be configured to alert the selected user of the status
of all performed checks on a regular basis or only when an error occurs.
@ -111,5 +111,5 @@ and or contact [discoverygarden].
[discoverygarden]: http://support.discoverygarden.ca
[filehash]: https://www.drupal.org/project/filehash
[gplv2]: http://www.gnu.org/licenses/gpl-2.0.txt
[install]: https://drupal.org/documentation/install/modules-themes/modules-8
[install]: https://www.drupal.org/docs/extending-drupal/installing-modules
[CTDA: Connecticut Digital Archive]: https://lib.uconn.edu/find/connecticut-digital-archive/

2
dgi_fixity.info.yml

@ -2,7 +2,7 @@ name: 'Fixity'
description: "Performs fixity checks on files."
type: module
package: DGI
core_version_requirement: ^8 || ^9
core_version_requirement: ^9 || ^10
configure: dgi_fixity.settings
dependencies:
- drupal:file

1
src/Controller/FixityCheckController.php

@ -235,6 +235,7 @@ class FixityCheckController extends ControllerBase {
->condition('id', $fixity_check->id())
->sort('performed', 'DESC')
->pager(50)
->accessCheck()
->execute();
return array_keys($result);
}

4
src/FixityCheckService.php

@ -293,6 +293,7 @@ class FixityCheckService implements FixityCheckServiceInterface {
->condition('performed', 0, '!=')
->groupBy('state')
->aggregate('id', 'COUNT')
->accessCheck(FALSE)
->execute();
$failed = 0;
@ -312,12 +313,14 @@ class FixityCheckService implements FixityCheckServiceInterface {
$periodic = (int) $storage->getQuery('AND')
->count('id')
->condition('periodic', TRUE)
->accessCheck(FALSE)
->execute();
// All checks performed ever.
$revisions = (int) $storage->getQuery('AND')
->allRevisions()
->count('id')
->accessCheck(FALSE)
->execute();
// Checks which have exceeded the threshold and should be performed again.
@ -326,6 +329,7 @@ class FixityCheckService implements FixityCheckServiceInterface {
->condition('periodic', TRUE)
->condition('performed', $threshold, '>=')
->count('id')
->accessCheck(FALSE)
->execute();
// Up to date checks.

Loading…
Cancel
Save