I have a View of Booking Items. Every Booking Item has a reference to a Booking. I want to show all Bookings in the calendar, so I fetch Booking Items and then aggregate the results and do a COUNT on the nid so I get the [Booking title] + [Number of child booking items].

Anyway, that works perfectly if I select a normal display plugin like HTML list. The result is a per-date title + count. When I select FullCalendar as display plugin, the aggregation seems to be ignored and ALL booking items show (every one with a count of 1). Somehow the query changes from

GROUP BY field_data_field_date_node_entity_type, field_data_field_date_field_date_value, node_field_data_field_booking_title

to

GROUP BY nid_2, field_data_field_date_node_entity_type

I've no idea why. All that's different is the display plugin. That shouldn't change the query...

I see the FullCalendar also adds a DISTINCT to the SELECT statement =( That's not the issue in this case, but it's still weird.

Any ideas?

Reproducing is very easy with 2 node types:

* Booking (title)
* Booking item (title, booking (node ref), date)

Comments

rudiedirkx’s picture

Oh actually the DISTINCT is the problem. Views does stuff to the query if the distinct flag is TRUE.

Why is it distinct?? It definitely shouldn't be ALWAYS. Easy fix, but still weird.