datatables-bundle
datatables-bundle copied to clipboard
A DataTable with no columns being pulled directly from Doctrine crashes
I noticed that there's an issue regarding query creation - in the event that only fields that do something during render are specified the table will fail to load outright and Doctrine will throw an error about expecting an expression, as the generated query looks like this:
SELECT FROM [entity] [alias]
The fix is simple, if nothing is being selected simply find the primary key and select that instead. The two COUNT calls seem to run just fine, as they search for ids by default so there's no issue there.