Skip to content

Commit

Permalink
[statistics] bug fix - projectID issue (aces#9170)
Browse files Browse the repository at this point in the history
Fixes error on statistics page:

```
[CRITICAL] /var/www/Loris/php/libraries/User.class.inc:476: Uncaught TypeError: User::hasProject(): Argument #1 ($projectID) must be of type ProjectID, string given, called in /var/www/Loris/modules/statistics/php/statistics_site.class.inc on line 134 and defined in /var/www/Loris/php/libraries/User.class.inc:476
```

Fixes aces#9137
  • Loading branch information
kongtiaowang authored Apr 4, 2024
1 parent a5b5189 commit 053dff6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/statistics/php/statistics_site.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ class Statistics_Site extends \NDB_Menu
{

//SITES

$factory = \NDB_Factory::singleton();
$user = $factory->user();
$projectID = new \ProjectID(strval($projectID));
$factory = \NDB_Factory::singleton();
$user = $factory->user();

if (!empty($centerID) && $user->hasCenter($centerID)) {
$this->query_criteria .= " AND s.CenterID =:cid ";
Expand Down

0 comments on commit 053dff6

Please sign in to comment.