Hello, guest. We have noticed that you are not registered at this bug tracker. Your experience will be greatly enhanced if you log in. To do so, you first must register by clicking on the Register tab at the top. If you are already registered, you can login at the Login tab.
Syndicate Syndicate Listing Display Search Login/Register
Bug Id ?
Reporter ?
Everah
Product/Version ?
Bugdar / 1.1.5
Status ?
Closed
Severity ?
Minor
Duplicate Of ?
- none -
Fixed in Revision ?
Mstone ?
Summary ?
PHP foreach warning on newreport.php line 177
Report Time ?
March 7, 2007 07:33 AM
Assignment ?
Resolution ?
Won't Fix
Priority ?
Normal
Dependencies ?
- none -
Mstone (old) ?


Votes
For: 0 (0%)
Against: 0 (0%)
Total: 0

March 7, 2007 07:33 AM Everah
On a fresh installation with no bugs in the database, when going to newreport.php I see the following warning:
Warning: Warning
Invalid argument supplied for foreach() in \newreport.php on line 177

Current local development setup for PHP has error_reporting at E_ALL and display_errors on.

I noticed on line 177 the following code:
foreach ($bugsys->datastore['assignto'] AS $dev)

perhaps encapsulating that in a check against is_array() would prevent that warning for non-array values for $bugsys->datastore['assignto']?

March 7, 2007 07:41 AM Everah
I believe this bug was from the installation add new user issue (Bug 67). For some reason the global admin user was not being seen in the list of assignees. Once I added a new user and edited the global admin, the issue here went away. I suspect then that the reason for this issue in the first place was that the global admin was not being seen as a potential assignee and therefore the app threw an error.

On a side note, whilst I had this error, it was showing on the settings page of the admin interface as well. Again, once the user situation was handled, that error went away as well.

March 7, 2007 05:04 PM Robert
Yes that would definitely be caused as a direct result of your other problem (bug 67). This normally wouldn't happen but because a function that builds the assignedto cache (the list of developers) wasn't run, it didn't create an empty array. When you edited the admin user, the cache was again rebuilt and the problem went away.

March 17, 2007 06:49 PM Robert
Because this would only ever happen if that cache isn't built (which means some other and more important problem exists) I'm not going to fix this.