Checking for existence of a field within a Matrix block In trying to test for the existence of a field within a Matrix block I think I may have stumbled upon a bug, or I'm missing something and approaching this the wrong way.

I've setup a simple test using a fresh, standard Craft install with a very basic Matrix setup. I've pasted the Matrix template code below.

    {% if entry.matrix is defined and entry.matrix|length %}

        {% for block in entry.matrix %}

            {% if block.type == "richText" %}

                {{ block.richText }}

            {% elseif block.type == "plainText" %}

                {{ block.plainText|markdown }}

            {% elseif block.type == "blockquote" %}

                {% if block.test is defined %}
                    &lt;p&gt;&lt;strong&gt;Uh oh! This field doesn't actually exist.&lt;/strong&gt;&lt;/p&gt;
                {% endif %}

                &lt;blockquote&gt;
                    &lt;p&gt;{{ block.quote }}&lt;/p&gt;
                    &lt;cite&gt;– {{ block.attribution }}&lt;/cite&gt;
                &lt;/blockquote&gt;

            {% endif %}

        {% endfor %}

    {% endif %}


Within the blockquote block I am checking if block.test is defined, this check always evaluates to true despite the fact that it doesn't exist and if I add any additional checks it bombs out the template.

Any insight is greatly appreciated!
Use brackets instead of dot notation for the field handle when you test for defined:

...
{% if block['test'] is defined %}
    ...
{% endif %}