Body: <p>I have started to get this error on a few contribution pages <code>Warning: in_array() expects parameter 2 to be array, null given in /civicrm/CRM/Core/BAO/CustomField.php on line 1241</code></p>
  <p>I think it started when I upgraded from 5.25.x to 5.26 (now on 5.26.1).</p>
  <p>Looking at the error message, log, and similar reports, I think I have tracked it down to a custom checkbox field that had a single option but no default value was set.</p>
  <p>When I set a default value the error message disappeared.  When I unset the default the error didn't return though I am unsure if that is a permanent fix.</p>
  <p>Just in case I have also upgraded to 5.26.2 and the error has not returned.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-10-06T15:16:15.053Z
Comments.Text: Question, I have the same error message. How did you find out which custom checkbox was causing the error?
Comments.UserDisplayName: CreativeA
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-10-06T18:13:03.103Z
Comments.Text: It was down to a process of elimination, checking which profiles were used by the contribution page, and then what custom fields were being used in the profiles.  As it was an array error I narrowed it down to anything that could have had multiple values, which helped speed up the process and thankfully I didn't have may profiles or custom fields to go through.
Comments.UserDisplayName: Christopher
Tags: <upgrade><error>
Title: Warning: in_array() expects parameter 2 to be array, null given in /civicrm/CRM/Core/BAO/CustomField.php on line 1241
ThreadText: # Warning: in_array() expects parameter 2 to be array, null given in /civicrm/CRM/Core/BAO/CustomField.php on line 1241
  
  (Asked by: username_0 on 2020-06-19)
  
  I have started to get this error on a few contribution pages `Warning: in_array() expects parameter 2 to be array, null given in /civicrm/CRM/Core/BAO/CustomField.php on line 1241`
  
  I think it started when I upgraded from 5.25.x to 5.26 (now on 5.26.1).
  
  Looking at the error message, log, and similar reports, I think I have tracked it down to a custom checkbox field that had a single option but no default value was set.
  
  When I set a default value the error message disappeared. When I unset the default the error didn't return though I am unsure if that is a permanent fix.
  
  Just in case I have also upgraded to 5.26.2 and the error has not returned.
  
  **Tags:** upgrade, error
  
  > **Comments:**
  > **username_1**: Question, I have the same error message. How did you find out which custom checkbox was causing the error?  
  > **username_0**: It was down to a process of elimination, checking which profiles were used by the contribution page, and then what custom fields were being used in the profiles.  As it was an array error I narrowed it down to anything that could have had multiple values, which helped speed up the process and thankfully I didn't have may profiles or custom fields to go through.  
  
  ---
  
  ## 0 answers
  
  