Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading home.php #4772

Closed
gchilders opened this issue Jun 10, 2022 · 0 comments · Fixed by #4774
Closed

Error loading home.php #4772

gchilders opened this issue Jun 10, 2022 · 0 comments · Fixed by #4774

Comments

@gchilders
Copy link
Contributor

After the latest changes for PHP 8, I'm seeing an error loading home.php using PHP 8.1:

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, stdClass given in /home/boincadm/projects/nfs/html/inc/user.inc:84 Stack trace: #0 /home/boincadm/projects/nfs/html/user/home.php(30): get_other_projects() #1 {main} thrown in /home/boincadm/projects/nfs/html/inc/user.inc on line 84

As a quick fix, I added a cast of the variable to type array on line 84 of user.inc:
if (count((array) $remote) == 1) {

This lead to similar errors on lines 118 and 120 of user.inc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants