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

Game development with Board Game Arena Studio
Post Reply
bryanvh
Posts: 3
Joined: 14 January 2024, 19:02

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

Post 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
User avatar
Victoria_La
Posts: 624
Joined: 28 December 2015, 20:55

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

Post 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
bryanvh
Posts: 3
Joined: 14 January 2024, 19:02

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

Post 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.
Post Reply

Return to “Developers”