Page 1 of 1

Invalid argument supplied for foreach() in table.game.php

Posted: 06 April 2024, 17:56
by bryanvh
Hey folks, I'm getting this error when I refresh with F5, and since I can't see the code for table.game.php it's difficult to understand root cause. I've seen this type of error described in other places, but those refer to a different part of table.game.php so I'm not sure it's relevant. Any ideas?

Code: Select all

Server syntax error:
Warning: Invalid argument supplied for foreach() in /var/tournoi/release/tournoi-240320-1000-gs/www/game/module/table/table.game.php on line 3249

Re: Invalid argument supplied for foreach() in table.game.php

Posted: 06 April 2024, 18:11
by Victoria_La
Check this https://en.doc.boardgamearena.com/Troubleshooting

If not there check your notifications, something is off - it cannot deserialize your history notifcations
a) Make sure you pass arguments array to all your moficiations even its empty [] - its not an optional argument
b) Make sure your arg* methods return array

Re: Invalid argument supplied for foreach() in table.game.php

Posted: 06 April 2024, 19:36
by bryanvh
Thanks for the quick reply! None of my states are defined with args. And this error happens when refreshing with F5, not during a call to notifyAllPlayers(). So I'm still searching for an explanation. I'm going to try disabling parts of my getAllDatas() function to see if I can pinpoint the root cause.