Skip to content

Commit

Permalink
[behavioural_qc] Fix fatal error in PHP 8.1 (#8245)
Browse files Browse the repository at this point in the history
This fixes the error:

```
<b>Fatal error</b>:  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.
  • Loading branch information
ridz1208 authored Dec 1, 2022
1 parent 1492ee4 commit 6288e0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/behavioural_qc/php/models/behaviouraldto.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand All @@ -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));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions modules/behavioural_qc/php/models/conflictsdto.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand All @@ -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));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions modules/behavioural_qc/php/models/incompletedto.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand All @@ -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));
}

/**
Expand Down

0 comments on commit 6288e0c

Please # to comment.