Answers.Body: <p>Looks like you found a bug. Here is a fix:</p>
  
  <p><a href="https://github.com/civicrm/civicrm-core/pull/9540" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/9540</a></p>
  
  <p>Could you please review it and leave feedback on github to speed along the merge process?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-14T15:44:31.003Z
Answers.LastActivityDate: 2016-12-14T15:44:31.003Z
Answers.UserDisplayName: Coleman
Body: <p>According to the documentation (<a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Pseudoconstant+(option+list)+Reference" rel="nofollow noreferrer">https://wiki.civicrm.org/confluence/display/CRMDOC/Pseudoconstant+(option+list)+Reference</a>) I should be able to pass a context to an api.getoptions call in order retrieve both enabled and disabled options for a field. However, it doesn't seem to be working. In fact, swapping out different contexts has no apparent effect on what is returned by the api call. Am I missing something?</p>
  
  <p>Sample code:</p>
  
  <pre><code>$opts = civicrm_api3('contribution', 'getoptions', array(
    'field' =&gt; "custom_5",
    'context' =&gt; 'get'
  ));
  </code></pre>
  
Tags: <api>
Title: using api.getoptions to retrieve all options for a field (even disabled)
ThreadText: # using api.getoptions to retrieve all options for a field (even disabled)
  
  (Asked by: username_0 on 2016-12-08)
  
  According to the documentation (<https://wiki.civicrm.org/confluence/display/CRMDOC/Pseudoconstant+(option+list)+Reference>) I should be able to pass a context to an api.getoptions call in order retrieve both enabled and disabled options for a field. However, it doesn't seem to be working. In fact, swapping out different contexts has no apparent effect on what is returned by the api call. Am I missing something?
  
  Sample code:
  
  ```
  $opts = civicrm_api3('contribution', 'getoptions', array(
    'field' => "custom_5",
    'context' => 'get'
  ));
  
  ```
  
  **Tags:** api
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-12-14. Score: 1
  
  Looks like you found a bug. Here is a fix:
  
  <https://github.com/civicrm/civicrm-core/pull/9540>
  
  Could you please review it and leave feedback on github to speed along the merge process?
  
  
  ---
  
  