Skip to content

Commit

Permalink
[media] bug fix - string to int (#9156)
Browse files Browse the repository at this point in the history
Fix error:

```
PHP Fatal error: Uncaught TypeError: LORIS\media\MediaFile::getHideFile(): Return value must be of type int, string returned in /var/www/Loris/modules/media/php/mediafile.class.inc:85\nStack trace:\n#0 /var/www/Loris/modules/media/php/hidefilefilter.class.inc(50): LORIS\media\MediaFile->getHideFile()\n#1 /var/www/Loris/src/Data/
```
  • Loading branch information
kongtiaowang authored Mar 25, 2024
1 parent e1aaa87 commit 6664a0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/media/php/mediafile.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class MediaFile implements \LORIS\Data\DataInstance,
*/
public function getHideFile(): int
{
return $this->DBRow['hideFile'];
if ($this->DBRow['hideFile'] == 'hidden') {
return 1;
}
return 0;
}
}

0 comments on commit 6664a0a

Please # to comment.