Answers.Body: <p>That should be all that’s required, but I’d highly recommend setting up a local development environment for this site so you don’t have to make changes to the live site and risk breaking it.</p>
  <p><a href="https://craftcms.com/docs/getting-started-tutorial/environment/stack.html" rel="nofollow noreferrer">https://craftcms.com/docs/getting-started-tutorial/environment/stack.html</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-15T23:43:26.967Z
Answers.LastActivityDate: 2024-01-15T23:43:26.967Z
Answers.UserDisplayName: Brad Bell
Body: <p>In my CP I'm seeing an error that says:</p>
  <p><code>Elements’ getSourceId() method has been deprecated. Use getCanonicalId() instead.</code></p>
  <p>It references
  <code>/storage/ad33d3/www/public_html/templates/jojojo/_sections/products/_partials/productDetails.twig:193</code></p>
  <p>When I look in that file I see this line:</p>
  <p><code>{entryId: entry.sourceId}) %}</code></p>
  <p>Is the fix as simple as changing that line to:</p>
  <p><code>{entryId: entry.canonicalId}) %}</code></p>
  <p>I'm relatively new to Craft/twig and this is a live site so I didn't want to just &quot;test&quot; it.</p>
  
Tags: <error-message><deprecation>
Title: How to fix an error deprecated error for sourceID
ThreadText: # How to fix an error deprecated error for sourceID
  
  (Asked by: username_0 on 2024-01-12)
  
  In my CP I'm seeing an error that says:
  
  `Elements’ getSourceId() method has been deprecated. Use getCanonicalId() instead.`
  
  It references
  `/storage/ad33d3/www/public_html/templates/jojojo/_sections/products/_partials/productDetails.twig:193`
  
  When I look in that file I see this line:
  
  `{entryId: entry.sourceId}) %}`
  
  Is the fix as simple as changing that line to:
  
  `{entryId: entry.canonicalId}) %}`
  
  I'm relatively new to Craft/twig and this is a live site so I didn't want to just "test" it.
  
  **Tags:** error-message, deprecation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-01-15. Score: 1 | Accepted answer
  
  That should be all that’s required, but I’d highly recommend setting up a local development environment for this site so you don’t have to make changes to the live site and risk breaking it.
  
  <https://craftcms.com/docs/getting-started-tutorial/environment/stack.html>
  
  
  ---
  
  