Answers.Body: <p>It's hard to answer definitively based on the information provided so far, but I can probably get you past the point you're at.</p>
  <p>First - the <a href="https://civicrm.stackexchange.com/q/15931/12">CiviCRM log</a> should have a backtrace to accompany this error.  Editing your question to include the backtrace will help folks give more specific advice.</p>
  <p>But broadly - you have some multiple-choice question that, for whatever reason, has no choices.  That's probably a data error.  The backtrace should provide some insight as to why this is failing.  For instance, if the field is the &quot;currency&quot; field, but you deleted all the currency options, this would happen.  The &quot;correct&quot; solution is to fix the data error.</p>
  <p>But there's a possibility that the lack of choices doesn't actually matter.  So if you look at the backtrace and decide that, the solution would be to change line 187 from this:</p>
  <pre><code>$fieldOptions = call_user_func(Civi\Core\Resolver::singleton()-&gt;get($pseudoconstant['callback']), $fieldName, $params);
  </code></pre>
  <p>to this:</p>
  <pre><code>$fieldOptions = call_user_func(Civi\Core\Resolver::singleton()-&gt;get($pseudoconstant['callback']), $fieldName, $params) ?? [];
  </code></pre>
  <p>This will fix the error at line 188 you're seeing.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-07T18:05:26.890Z
Answers.LastActivityDate: 2024-03-07T18:05:26.890Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Drupal 7.99 running PHP 8.1 - we are running into an issue during the upgrade from 5.63 to 5.69; the upgrade fails during the last queue runner on 5.69 with the following error: TypeError: Argument 2 passed to CRM_Core_PseudoConstant::formatArrayOptions() must be of the type array, null given, called in /sites/all/modules/civicrm/CRM/Core/PseudoConstant.php on line 188 in CRM_Core_PseudoConstant::formatArrayOptions()</p>
  <p>At first I thought this was a PHP 8.x error, but after attempting to patch the code, the upgrade still fails.</p>
  <p>Line 188: $fieldOptions = call_user_func(Civi\Core\Resolver::singleton()-&gt;get($pseudoconstant['callback']), $fieldName, $params);</p>
  <p>Any advice would be great, thank you.</p>
  <p><a href="https://docs.civicrm.org/dev/en/latest/framework/pseudoconstant/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/framework/pseudoconstant/</a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-03-07T10:55:21.620Z
Comments.Text: where are you getting this error?
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-03-07T17:59:48.113Z
Comments.Text: The line you labeled as line 188 is actually line 187.
Comments.UserDisplayName: Jon G - Megaphone Tech
Tags: <drupal>
Title: CiviCRM 5.69.4: CRM_Core_PseudoConstant::formatArrayOptions() must be of the type array, null given
ThreadText: # CiviCRM 5.69.4: CRM_Core_PseudoConstant::formatArrayOptions() must be of the type array, null given
  
  (Asked by: username_0 on 2024-03-06)
  
  Drupal 7.99 running PHP 8.1 - we are running into an issue during the upgrade from 5.63 to 5.69; the upgrade fails during the last queue runner on 5.69 with the following error: TypeError: Argument 2 passed to CRM\_Core\_PseudoConstant::formatArrayOptions() must be of the type array, null given, called in /sites/all/modules/civicrm/CRM/Core/PseudoConstant.php on line 188 in CRM\_Core\_PseudoConstant::formatArrayOptions()
  
  At first I thought this was a PHP 8.x error, but after attempting to patch the code, the upgrade still fails.
  
  Line 188: $fieldOptions = call\_user\_func(Civi\Core\Resolver::singleton()->get($pseudoconstant['callback']), $fieldName, $params);
  
  Any advice would be great, thank you.
  
  <https://docs.civicrm.org/dev/en/latest/framework/pseudoconstant/>
  
  **Tags:** drupal
  
  > **Comments:**
  > **username_1**: where are you getting this error?  
  > **username_2**: The line you labeled as line 188 is actually line 187.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-03-07. Score: 1
  
  It's hard to answer definitively based on the information provided so far, but I can probably get you past the point you're at.
  First - the CiviCRM log should have a backtrace to accompany this error.  Editing your question to include the backtrace will help folks give more specific advice.
  But broadly - you have some multiple-choice question that, for whatever reason, has no choices.  That's probably a data error.  The backtrace should provide some insight as to why this is failing.  For instance, if the field is the "currency" field, but you deleted all the currency options, this would happen.  The "correct" solution is to fix the data error.
  But there's a possibility that the lack of choices doesn't actually matter.  So if you look at the backtrace and decide that, the solution would be to change line 187 from this:
  $fieldOptions = call_user_func(Civi\Core\Resolver::singleton()->get($pseudoconstant['callback']), $fieldName, $params);
  
  to this:
  $fieldOptions = call_user_func(Civi\Core\Resolver::singleton()->get($pseudoconstant['callback']), $fieldName, $params) ?? [];
  
  This will fix the error at line 188 you're seeing.
  
  
  ---
  
  