From b6b2e71866ce4a1af7765381166d1a5307504a3d Mon Sep 17 00:00:00 2001 From: Shen Date: Thu, 1 Feb 2024 14:38:58 -0500 Subject: [PATCH 1/5] [data_release] Fix data release sort issue (#8636) Resolves #8621 --- modules/data_release/php/data_release.class.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/data_release/php/data_release.class.inc b/modules/data_release/php/data_release.class.inc index 4234b671416..32986cd624c 100644 --- a/modules/data_release/php/data_release.class.inc +++ b/modules/data_release/php/data_release.class.inc @@ -61,7 +61,7 @@ class Data_Release extends \NDB_Menu_Filter // set the class variables $this->columns = [ 'file_name AS fileName', - 'IF(version is null or version ="","Unversioned", version) AS version', + 'IFNULL(NULLIF(version, "" ), "Unversioned" ) AS version', 'upload_date AS uploadDate', 'dr.id as dataReleaseID', ]; From 34d2f06daec5a38a028a0ec9702004f3348a77a4 Mon Sep 17 00:00:00 2001 From: Laetitia Fesselier Date: Tue, 27 Feb 2024 10:31:36 -0500 Subject: [PATCH 2/5] [MRI Violations] Fix violated_scans_view_allsites permission (#9057) The permission violated_scans_view_allsites does not work anymore for the module. This fixes the issue. --- modules/mri_violations/php/mri_violations.class.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/mri_violations/php/mri_violations.class.inc b/modules/mri_violations/php/mri_violations.class.inc index 71a8797fe66..9daeefcdcc7 100644 --- a/modules/mri_violations/php/mri_violations.class.inc +++ b/modules/mri_violations/php/mri_violations.class.inc @@ -144,7 +144,11 @@ class Mri_Violations extends \DataFrameworkMenu ); default: return (new Provisioner()) - ->filter(new UserCenterMatchOrNull()) + ->filter( + new UserCenterMatchOrNullOrAnyPermission( + $this->allSitePermissionNames(), + ) + ) ->filter(new UserProjectMatchOrNull()); } } From 0e8db0e51e4bd890f089acb44392ad3536a73c3e Mon Sep 17 00:00:00 2001 From: Shen Date: Mon, 12 Aug 2024 11:10:03 -0400 Subject: [PATCH 3/5] Fix GitHub Actions failure on the 25 (#9322) Fix failing tests on Github Actions. --- test/dockerized-integration-tests.sh | 2 +- test/dockerized-unit-tests.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/dockerized-integration-tests.sh b/test/dockerized-integration-tests.sh index dabd92fe971..28c01e98409 100755 --- a/test/dockerized-integration-tests.sh +++ b/test/dockerized-integration-tests.sh @@ -21,4 +21,4 @@ else fi # Core integration tests -docker-compose run -T --rm ${CONTAINER} vendor/bin/phpunit --configuration test/phpunit.xml --testsuite LorisCoreIntegrationTests,LorisModuleIntegrationTests ${FILTER} $* +docker compose run -T --rm ${CONTAINER} vendor/bin/phpunit --configuration test/phpunit.xml --testsuite LorisCoreIntegrationTests,LorisModuleIntegrationTests ${FILTER} $* diff --git a/test/dockerized-unit-tests.sh b/test/dockerized-unit-tests.sh index 2253c98c509..a4bd776b1f0 100755 --- a/test/dockerized-unit-tests.sh +++ b/test/dockerized-unit-tests.sh @@ -8,4 +8,4 @@ else CONTAINER=unit-tests fi -docker-compose run -T --rm ${CONTAINER} vendor/bin/phpunit --configuration test/phpunit.xml --testsuite LorisUnitTests $* +docker compose run -T --rm ${CONTAINER} vendor/bin/phpunit --configuration test/phpunit.xml --testsuite LorisUnitTests $* From 99018deba3b7be4533ddd270404f58de8c4b0196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9cile=20Madjar?= Date: Tue, 1 Oct 2024 11:40:09 -0400 Subject: [PATCH 4/5] fix generic_includes.php returning error "Undefined variable in /var/www/loris/tools/generic_includes.php on line 28" - 25 branch (#9318) This fixes the script `generic_includes.php` that calls the $DB variable before it is defined when calling LorisInstance. Without this fix, anything calling `generic_includes.php` will trigger the following error: ``` Undefined variable in /var/www/loris/tools/generic_includes.php on line 28 PHP Fatal error: Uncaught TypeError: LORIS\\LorisInstance::__construct(): Argument #1 ($db) must be of type Database, null given, called in /var/www/loris/tools/generic_includes.php on line 27 ``` --- tools/generic_includes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generic_includes.php b/tools/generic_includes.php index 43c241931c6..3ec54ca892d 100644 --- a/tools/generic_includes.php +++ b/tools/generic_includes.php @@ -24,6 +24,7 @@ $client->makeCommandLine(); $client->initialize($configFile); $config = NDB_Config::singleton(); +$DB = NDB_Factory::singleton()->database(); $lorisInstance = new \LORIS\LorisInstance( $DB, $config, @@ -32,4 +33,3 @@ __DIR__ . "/../modules/", ], ); -$DB = $lorisInstance->getDatabaseConnection(); From 9177127943db7c816e488c2ac2de126566e91efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9cile=20Madjar?= Date: Tue, 1 Oct 2024 14:17:21 -0400 Subject: [PATCH 5/5] [API] Fix PUT request not updating image's QC values (#9376) This fixes the PUT request not updating the image's QC values when testing the API via the Swagger. Resolves #7917 --- .../api/php/endpoints/candidate/visit/image/qc.class.inc | 2 +- raisinbread/test/api/LorisApiImagesTest.php | 8 ++++---- raisinbread/test/api/LorisApiImages_v0_0_3_Test.php | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/api/php/endpoints/candidate/visit/image/qc.class.inc b/modules/api/php/endpoints/candidate/visit/image/qc.class.inc index 2072779b2b6..0bcd2e939a9 100644 --- a/modules/api/php/endpoints/candidate/visit/image/qc.class.inc +++ b/modules/api/php/endpoints/candidate/visit/image/qc.class.inc @@ -165,7 +165,7 @@ class Qc extends Endpoint implements \LORIS\Middleware\ETagCalculator ); } - $inputqcstatus = $data['QCStatus'] ?? null; + $inputqcstatus = $data['QC'] ?? null; $inputselected = $data['Selected'] ?? null; // TODO :: This is (and was) not checking or handling Caveats diff --git a/raisinbread/test/api/LorisApiImagesTest.php b/raisinbread/test/api/LorisApiImagesTest.php index af068ac177a..576954b4043 100644 --- a/raisinbread/test/api/LorisApiImagesTest.php +++ b/raisinbread/test/api/LorisApiImagesTest.php @@ -137,7 +137,7 @@ public function testGetCandidatesCandidVisitImagesFilename(): void ), true ); - $this->assertEquals(null, $imagesArray); + $this->assertEquals(null, $imagesArray); } /** @@ -286,7 +286,7 @@ public function testPutCandidatesCandidVisitImagesFilenameQc(): void 'Visit' => $visit, 'File' => $filename ], - "QC" => 'pass', + "QC" => 'Pass', "Selected" => false, 'Caveats' => [ '0' => [ @@ -335,7 +335,7 @@ public function testGetCandidatesCandidVisitImagesFilenameFormatBbrowser(): void "candidates/$this->candidTest/$this->visitTest/images/" . "$this->imagefileTest/format/brainbrowser" ); - } + } $this->assertEquals(200, $response->getStatusCode()); // Verify the endpoint has a body $body = $response->getBody(); @@ -401,7 +401,7 @@ public function testGetCandidatesCandidVisitImagesFilenameFormatBbrowser(): void $this->assertArrayHasKey('zspace', $imagesArray); $this->assertArrayHasKey('space_length', $imagesArray['zspace']); $this->assertArrayHasKey('start', $imagesArray['zspace']); - $this->assertArrayHasKey('step', $imagesArray['zspace']); + $this->assertArrayHasKey('step', $imagesArray['zspace']); } /** diff --git a/raisinbread/test/api/LorisApiImages_v0_0_3_Test.php b/raisinbread/test/api/LorisApiImages_v0_0_3_Test.php index c6b65abde60..079a3e7be55 100644 --- a/raisinbread/test/api/LorisApiImages_v0_0_3_Test.php +++ b/raisinbread/test/api/LorisApiImages_v0_0_3_Test.php @@ -136,7 +136,7 @@ public function testGetCandidatesCandidVisitImagesFilename(): void ), true ); - $this->assertEquals(null, $imagesArray); + $this->assertEquals(null, $imagesArray); } /** @@ -285,7 +285,7 @@ public function testPutCandidatesCandidVisitImagesFilenameQc(): void 'Visit' => $visit, 'File' => $filename ], - "QC" => 'pass', + "QC" => 'Pass', "Selected" => false, 'Caveats' => [ '0' => [ @@ -334,7 +334,7 @@ public function testGetCandidatesCandidVisitImagesFilenameFormatBbrowser(): void "candidates/$this->candidTest/$this->visitTest/images/" . "$this->imagefileTest/format/brainbrowser" ); - } + } $this->assertEquals(200, $response->getStatusCode()); // Verify the endpoint has a body $body = $response->getBody(); @@ -400,7 +400,7 @@ public function testGetCandidatesCandidVisitImagesFilenameFormatBbrowser(): void $this->assertArrayHasKey('zspace', $imagesArray); $this->assertArrayHasKey('space_length', $imagesArray['zspace']); $this->assertArrayHasKey('start', $imagesArray['zspace']); - $this->assertArrayHasKey('step', $imagesArray['zspace']); + $this->assertArrayHasKey('step', $imagesArray['zspace']); } /**