From 6288e0ca4c2e55b5ed6e69b732480a9db172f913 Mon Sep 17 00:00:00 2001 From: Rida Abou-Haidar Date: Thu, 1 Dec 2022 14:02:11 -0500 Subject: [PATCH] [behavioural_qc] Fix fatal error in PHP 8.1 (#8245) This fixes the error: ``` Fatal error: Uncaught TypeError: ValidatableIdentifier::__construct(): Argument #1 ($value) must be of type string, int given, called in /var/www/loris/modules/behavioural_qc/php/models/incompletedto.class.inc on line 126 ``` when the module is run on PHP 8.1. --- modules/behavioural_qc/php/models/behaviouraldto.class.inc | 4 ++-- modules/behavioural_qc/php/models/conflictsdto.class.inc | 4 ++-- modules/behavioural_qc/php/models/incompletedto.class.inc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/behavioural_qc/php/models/behaviouraldto.class.inc b/modules/behavioural_qc/php/models/behaviouraldto.class.inc index 891aaa1f69e..da33721c0af 100644 --- a/modules/behavioural_qc/php/models/behaviouraldto.class.inc +++ b/modules/behavioural_qc/php/models/behaviouraldto.class.inc @@ -126,7 +126,7 @@ class BehaviouralDTO implements \LORIS\Data\DataInstance, */ public function getCenterID(): \CenterID { - return new \CenterID($this->_site); + return new \CenterID(strval($this->_site)); } /** @@ -137,7 +137,7 @@ class BehaviouralDTO implements \LORIS\Data\DataInstance, */ public function getProjectID(): \ProjectID { - return new \ProjectID($this->_project); + return new \ProjectID(strval($this->_project)); } /** diff --git a/modules/behavioural_qc/php/models/conflictsdto.class.inc b/modules/behavioural_qc/php/models/conflictsdto.class.inc index cb108b86056..bf1887f1c31 100644 --- a/modules/behavioural_qc/php/models/conflictsdto.class.inc +++ b/modules/behavioural_qc/php/models/conflictsdto.class.inc @@ -112,7 +112,7 @@ class ConflictsDTO implements \LORIS\Data\DataInstance, */ public function getCenterID(): \CenterID { - return new \CenterID($this->_site); + return new \CenterID(strval($this->_site)); } /** @@ -123,7 +123,7 @@ class ConflictsDTO implements \LORIS\Data\DataInstance, */ public function getProjectID(): \ProjectID { - return new \ProjectID($this->_project); + return new \ProjectID(strval($this->_project)); } /** diff --git a/modules/behavioural_qc/php/models/incompletedto.class.inc b/modules/behavioural_qc/php/models/incompletedto.class.inc index 7b837e6c5c2..dea8b8861f6 100644 --- a/modules/behavioural_qc/php/models/incompletedto.class.inc +++ b/modules/behavioural_qc/php/models/incompletedto.class.inc @@ -112,7 +112,7 @@ class IncompleteDTO implements \LORIS\Data\DataInstance, */ public function getCenterID(): \CenterID { - return new \CenterID($this->_site); + return new \CenterID(strval($this->_site)); } /** @@ -123,7 +123,7 @@ class IncompleteDTO implements \LORIS\Data\DataInstance, */ public function getProjectID(): \ProjectID { - return new \ProjectID($this->_project); + return new \ProjectID(strval($this->_project)); } /**