Answers.Body: <p>You should replace <code>craft.fields.getFieldbyHandle()</code> with <code>craft.app.fields.getFieldByHandle()</code> (note the additional <code>.app</code> in there).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-15T17:28:49.980Z
Answers.LastActivityDate: 2020-07-15T17:28:49.980Z
Answers.UserDisplayName: Oli
Body: <p>I'm querying a dropdown field to loop through all of the options and followed best practice (so I thought) in the twig template. Does anyone know how to update for the deprecation below?</p>
  <p>Deprecation message:</p>
  <blockquote>
  <p>craft.fields.getFieldByHandle() has been deprecated. Use craft.app.fields.getFieldByHandle() instead.</p>
  </blockquote>
  <p>Code line:
  <code>{% set siteOptions = craft.fields.getFieldbyHandle('siteSelector').settings.options %}</code></p>
  
Tags: <deprecation>
Title: craft.fields.getFieldByHandle() has been deprecated
ThreadText: # craft.fields.getFieldByHandle() has been deprecated
  
  (Asked by: username_0 on 2020-07-15)
  
  I'm querying a dropdown field to loop through all of the options and followed best practice (so I thought) in the twig template. Does anyone know how to update for the deprecation below?
  
  Deprecation message:
  
  > craft.fields.getFieldByHandle() has been deprecated. Use craft.app.fields.getFieldByHandle() instead.
  
  Code line:
  `{% set siteOptions = craft.fields.getFieldbyHandle('siteSelector').settings.options %}`
  
  **Tags:** deprecation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-07-15. Score: 2 | Accepted answer
  
  You should replace `craft.fields.getFieldbyHandle()` with `craft.app.fields.getFieldByHandle()` (note the additional `.app` in there).
  
  
  ---
  
  