Answers.Body: <p>Looking at the code where your errors is occurring (line 46 of craft/app/fieldtypes/BaseOptionsFieldType.php), it looks like you have either a Checkboxes or Multi-Select field whose <code>options</code> setting is somehow set, but not set to an array. Not sure how it could have gotten into that state, but that’s the only thing that would explain your error.</p>
  
  <p>Try re-saving any Checkboxes/Multi-Select fields (or if you have any 3rd party field types installed that might be extending Craft’s BaseOptionsFieldType, that would be even more likely the culprit), ensuring they have at least one option set.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-08T12:51:01.433Z
Answers.Text: Great, thanks Brandon. This has fixed the problem. 
  
  A checkbox field was saved with a row but containing no options. Removing the row and saving has fixed. Cheers!
Answers.UserDisplayName: Cole Henley
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-08T12:23:44.137Z
Answers.LastActivityDate: 2017-09-08T12:23:44.137Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>We've made a local copy of a site that is working fine in a staging environment but locally is getting the following error: </p>
  
  <pre><code>`Invalid argument supplied for foreach()`
  </code></pre>
  
  <p>Seemingly coming from <code>craft/app/fieldtypes/BaseOptionsFieldtype</code>.</p>
  
  <p>Does anybody have any thoughts on what is causing this and how to resolve? Is happening both in the front-end and the admin area. </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-13T22:19:19.357Z
Comments.Text: Can you enable devMode and share the full stack trace leading up to that error?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-07T14:53:00.133Z
Comments.Text: So hit this problem again and cannot recall solution (payback for not posting up here …)
  
  Stack trace as follows:
  
  https://gist.github.com/cole007/a1fa47d90e4b3e125b608ecdf4944681
Comments.UserDisplayName: Cole Henley
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-07T16:07:56.337Z
Comments.Text: Regarding above, this follows an upgrade from 2.6.2950 to 2.6.2989
  
  Any thoughts why above upgrade may be causing site not to load?
  Also of note is use of custom locales for this site
Comments.UserDisplayName: Cole Henley
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-07T16:34:22.707Z
Comments.Text: Is there something past step #10 in the stack trace that tells you the template/line the error is coming from?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-08T08:10:42.433Z
Comments.Text: updated gist for full stack trace
Comments.UserDisplayName: Cole Henley
Tags: <error-message><error>
Title: `Invalid argument supplied for foreach()` error
ThreadText: # `Invalid argument supplied for foreach()` error
  
  (Asked by: username_0 on 2017-01-13)
  
  We've made a local copy of a site that is working fine in a staging environment but locally is getting the following error:
  
  ```
  `Invalid argument supplied for foreach()`
  
  ```
  
  Seemingly coming from `craft/app/fieldtypes/BaseOptionsFieldtype`.
  
  Does anybody have any thoughts on what is causing this and how to resolve? Is happening both in the front-end and the admin area.
  
  **Tags:** error-message, error
  
  > **Comments:**
  > **username_1**: Can you enable devMode and share the full stack trace leading up to that error?  
  > **username_0**: So hit this problem again and cannot recall solution (payback for not posting up here …)  Stack trace as follows:  https://gist.github.com/cole007/a1fa47d90e4b3e125b608ecdf4944681  
  > **username_0**: Regarding above, this follows an upgrade from 2.6.2950 to 2.6.2989  Any thoughts why above upgrade may be causing site not to load? Also of note is use of custom locales for this site  
  > **username_1**: Is there something past step #10 in the stack trace that tells you the template/line the error is coming from?  
  > **username_0**: updated gist for full stack trace  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-09-08. Score: 2 | Accepted answer
  
  Looking at the code where your errors is occurring (line 46 of craft/app/fieldtypes/BaseOptionsFieldType.php), it looks like you have either a Checkboxes or Multi-Select field whose `options` setting is somehow set, but not set to an array. Not sure how it could have gotten into that state, but that’s the only thing that would explain your error.
  
  Try re-saving any Checkboxes/Multi-Select fields (or if you have any 3rd party field types installed that might be extending Craft’s BaseOptionsFieldType, that would be even more likely the culprit), ensuring they have at least one option set.
  
  > **Comments:**
  > **username_0**: Great, thanks username_2. This has fixed the problem.   A checkbox field was saved with a row but containing no options. Removing the row and saving has fixed. Cheers!  
  
  ---
  
  