Answers.Body: <p>I think you need to add the fieldId() param to your query as per <a href="https://github.com/craftcms/cms/issues/1789" rel="nofollow noreferrer">https://github.com/craftcms/cms/issues/1789</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-18T09:56:39.303Z
Answers.LastActivityDate: 2019-01-18T09:56:39.303Z
Answers.UserDisplayName: mijewe
Body: <p>I'm a bit confused by the way that Craft now handles Matrix blocks. I've read the documentation a few times and I'm still not sure if I have it.</p>
  
  <p>Here's what I have:</p>
  
  <pre><code>{% set myMatrixBlockQuery = craft.matrixBlocks().ownerId(4).type('block__artists') %}
  {% set matrixBlocks = myMatrixBlockQuery.all() %}
  {% for block in matrixBlocks %}
    &lt;li&gt;{{ block.id }} / {{ block.artistName }}&lt;/li&gt;
  {% endfor %}
  </code></pre>
  
  <p>But all that gets output is:</p>
  
  <pre><code>8 /
  9 /
  10 /
  </code></pre>
  
  <p>Where <code>10</code> (etc) is the ID of the block. It's not outputting the artistName despite that field existing and having content. Is my query wrong?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-17T16:45:15.833Z
Comments.Text: is your artistName field a plaintext field? What outputs when you do `{{ dump(block) }}` inside your loop?
Comments.UserDisplayName: Gavin Gregory
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-17T17:11:09.853Z
Comments.Text: Yeah it's a plaintext field. The output I get mostly all seem to be attributed as NULL which is weird. One of the only fields that isn't is the ID field. Full output is here: https://pastebin.com/EFQp64Ya — this is looped over 3 times
Comments.UserDisplayName: Chrish
Tags: <matrix>
Title: Query returns nothing on matrixBlock
ThreadText: # Query returns nothing on matrixBlock
  
  (Asked by: username_0 on 2019-01-17)
  
  I'm a bit confused by the way that Craft now handles Matrix blocks. I've read the documentation a few times and I'm still not sure if I have it.
  
  Here's what I have:
  
  ```
  {% set myMatrixBlockQuery = craft.matrixBlocks().ownerId(4).type('block__artists') %}
  {% set matrixBlocks = myMatrixBlockQuery.all() %}
  {% for block in matrixBlocks %}
    <li>{{ block.id }} / {{ block.artistName }}</li>
  {% endfor %}
  
  ```
  
  But all that gets output is:
  
  ```
  8 /
  9 /
  10 /
  
  ```
  
  Where `10` (etc) is the ID of the block. It's not outputting the artistName despite that field existing and having content. Is my query wrong?
  
  **Tags:** matrix
  
  > **Comments:**
  > **username_1**: is your artistName field a plaintext field? What outputs when you do `{{ dump(block) }}` inside your loop?  
  > **username_0**: Yeah it's a plaintext field. The output I get mostly all seem to be attributed as NULL which is weird. One of the only fields that isn't is the ID field. Full output is here: https://pastebin.com/EFQp64Ya — this is looped over 3 times  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-01-18. Score: 2
  
  I think you need to add the fieldId() param to your query as per <https://github.com/craftcms/cms/issues/1789>
  
  
  ---
  
  