Answers.Body: <p>You're outputting an unexecuted <a href="https://craftcms.com/docs/4.x/element-queries.html" rel="nofollow noreferrer">Element Query</a>. To clarify - the thing stored in your Entries field named <code>buttonLink</code> is not a Craft entry as you might expect, but is basically a raw unexecuted database query (that will fetch the selected entry once executed). In Craft 3 those unexecuted queries automatically got executed if you attempt to output them, but they should throw deprecation errors in the control panel (Utilities &gt; Deprecation Errors). In Craft 4 you can't get away with that anymore.</p>
  <p>The quick and easy solution is to execute the query. There are a few ways to execute queries: <a href="https://craftcms.com/docs/4.x/element-queries.html#executing-element-queries" rel="nofollow noreferrer">https://craftcms.com/docs/4.x/element-queries.html#executing-element-queries</a></p>
  <p>But really, the &quot;proper&quot; solution here is to add some <a href="https://craftcms.com/docs/4.x/dev/eager-loading-elements.html" rel="nofollow noreferrer">eager loading</a> so that all your child queries are combined into the queries used to fetch the parent matrix block(s). This is significantly more performant, especially if you're outputting multiple matrix blocks (though I see from your code you're only outputting one).</p>
  <p>Here's how eager loading might look for your code:</p>
  <pre><code>{% set button = cta.button.with('buttonLink').one() %}
  &lt;a href=&quot;{{ button.buttonLink[0].url }}&quot;&gt;&lt;div class=&quot;button&quot;&gt;{{ button.buttonText }}&lt;/div&gt;&lt;/a&gt;
  </code></pre>
  <p>Or without eager loading (don't do this):</p>
  <pre><code>{% set button = cta.button.one() %}
  &lt;a href=&quot;{{ button.buttonLink.one().url }}&quot;&gt;&lt;div class=&quot;button&quot;&gt;{{ button.buttonText }}&lt;/div&gt;&lt;/a&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-15T06:37:32.217Z
Answers.Text: Thank your very much for your answer!
Answers.UserDisplayName: aren
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-14T15:17:14.900Z
Answers.LastActivityDate: 2022-06-14T15:17:14.900Z
Answers.UserDisplayName: James Smith
Body: <p>Some of my links coming from a matrix field with entry became corrupted. Anyone had this before and knows how to fix it?
  <a href="https://i.sstatic.net/QMBou.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QMBou.png" alt="admin field" /></a>
  <a href="https://i.sstatic.net/5nLIS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5nLIS.png" alt="entry" /></a>
  <a href="https://i.sstatic.net/0hO3Z.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0hO3Z.png" alt="corrupted link" /></a>
  <a href="https://i.sstatic.net/gbjpt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gbjpt.png" alt="enter image description here" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-14T10:17:57.673Z
Comments.Text: It looks like you're trying to output an unexecuted Element Query. Please can you add your template code responsible for this output and we'll help explain how best to fix.
Comments.UserDisplayName: James Smith
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-14T11:27:21.263Z
Comments.Text: I added it. Thanks for your response!
Comments.UserDisplayName: aren
Tags: <matrix><field><error><link>
Title: Matrix field entry link corrupted
ThreadText: # Matrix field entry link corrupted
  
  (Asked by: username_0 on 2022-06-14)
  
  Some of my links coming from a matrix field with entry became corrupted. Anyone had this before and knows how to fix it?
  [![admin field](https://i.sstatic.net/QMBou.png)](https://i.sstatic.net/QMBou.png)
  [![entry](https://i.sstatic.net/5nLIS.png)](https://i.sstatic.net/5nLIS.png)
  [![corrupted link](https://i.sstatic.net/0hO3Z.png)](https://i.sstatic.net/0hO3Z.png)
  [![enter image description here](https://i.sstatic.net/gbjpt.png)](https://i.sstatic.net/gbjpt.png)
  
  **Tags:** matrix, field, error, link
  
  > **Comments:**
  > **username_1**: It looks like you're trying to output an unexecuted Element Query. Please can you add your template code responsible for this output and we'll help explain how best to fix.  
  > **username_0**: I added it. Thanks for your response!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-06-14. Score: 1 | Accepted answer
  
  You're outputting an unexecuted [Element Query](https://craftcms.com/docs/4.x/element-queries.html). To clarify - the thing stored in your Entries field named `buttonLink` is not a Craft entry as you might expect, but is basically a raw unexecuted database query (that will fetch the selected entry once executed). In Craft 3 those unexecuted queries automatically got executed if you attempt to output them, but they should throw deprecation errors in the control panel (Utilities > Deprecation Errors). In Craft 4 you can't get away with that anymore.
  
  The quick and easy solution is to execute the query. There are a few ways to execute queries: <https://craftcms.com/docs/4.x/element-queries.html#executing-element-queries>
  
  But really, the "proper" solution here is to add some [eager loading](https://craftcms.com/docs/4.x/dev/eager-loading-elements.html) so that all your child queries are combined into the queries used to fetch the parent matrix block(s). This is significantly more performant, especially if you're outputting multiple matrix blocks (though I see from your code you're only outputting one).
  
  Here's how eager loading might look for your code:
  
  ```
  {% set button = cta.button.with('buttonLink').one() %}
  <a href="{{ button.buttonLink[0].url }}"><div class="button">{{ button.buttonText }}</div></a>
  
  ```
  
  Or without eager loading (don't do this):
  
  ```
  {% set button = cta.button.one() %}
  <a href="{{ button.buttonLink.one().url }}"><div class="button">{{ button.buttonText }}</div></a>
  
  ```
  
  > **Comments:**
  > **username_0**: Thank your very much for your answer!  
  
  ---
  
  