Shouldn't this merge be working? Can anyone help me work out why the following returns the error "The merge filter only works with arrays or hashes."?

{# CREATE ARRAY TO HOLD ALL OF TODAY'S EVENTS #}
{% set todaysEvents = [] %}

{# GET TODAY'S ONE-OFF EVENTS #}
{# RETURNS ENTRIES NICELY IF LOOPED THROUGH #}
{% set todaysOneOffEvents = craft.entries.section('events').eventDate('= '~today | date("Y-m-d")) %}

{# ADD TODAY'S ONE-OFF EVENTS TO TODAY'S EVENTS %}
{# THIS RETURNS MERGE ARRAY ERROR #}
{% set todaysEvents = todaysEvents|merge(todaysOneOffEvents) %}
Try adding find() to your ElementCriteriaModel, I think without that function you're not actually saving your entries as an array in your variable todaysOneOffEvents yet.

Here's what I found in the Docs:


  You don’t actually need to call find() yourself though: It will be called automatically as soon as the ElementCriteriaModel is treated like an array (that is, as soon as you check how many elements there are using the |length filter, or start looping through the elements with a {% for %} loop).


We learn that merging doesn't "treat it like an array", good to know.

Edit: You can't use the length filter to "convert" the content of the variable to an actual array. Removed that part from the answer.