Browse Source

Merge pull request #10 from discoverygarden/fix/d10-support

D10-28: D10 support.
pull/11/head v1.1.2
Noel Chiasson 1 year ago committed by GitHub
parent
commit
6513ea1184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      README.md
  2. 2
      dgi_fixity.info.yml
  3. 1
      src/Controller/FixityCheckController.php
  4. 4
      src/FixityCheckService.php

2
README.md

@ -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