Skip to content

Uncaught TypeError: Cannot read property 'hasOwnProperty' of null #29

@ghost

Description

I have a filter with options as shown below which works perfect when browsing entries. However when I use this filter in a field with the fieldtype "entries" to select related articles it gives me the error as shown at the bottom of this issue.

Filter options:

{% for category in craft.categories.group('interests').all() %}
    {{ ({
        filter: {
            relatedTo: {
                element: category.id,
            }
        },
        label: category.title
    })|json_encode() }}{{ not loop.last ? ',' }}
{% endfor %}

Error code:

ElementFilters.js?v=1586255504:238 Uncaught TypeError: Cannot read property 'hasOwnProperty' of null
    at ElementFilters.js?v=1586255504:238
    at Array.forEach (<anonymous>)
    at updateCriteriaValue (ElementFilters.js?v=1586255504:235)
    at ElementFilters.js?v=1586255504:217
    at Array.forEach (<anonymous>)
    at updateCriteria (ElementFilters.js?v=1586255504:216)
    at HTMLDivElement.filterHandler (ElementFilters.js?v=1586255504:286)

95874083-d078ad80-0d70-11eb-8316-75b016619fc2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions