<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>

CC BY-SA 4.0
2019-01-18T09:56:39.303Z
2019-01-18T09:56:39.303Z
mijewe
<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>

CC BY-SA 4.0
2019-01-17T16:45:15.833Z
is your artistName field a plaintext field? What outputs when you do `{{ dump(block) }}` inside your loop?
Gavin Gregory
CC BY-SA 4.0
2019-01-17T17:11:09.853Z
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
Chrish
<matrix>
Query returns nothing on matrixBlock
# 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 %}
  {{ block.id }} / {{ block.artistName }}
{% 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>


---

