omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
252 stars 113 forks source link

A DataTable with no columns being pulled directly from Doctrine crashes #190

Closed pkly closed 1 year ago

pkly commented 3 years ago

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.

github-actions[bot] commented 1 year ago

Stale issue message

curry684 commented 1 year ago

in the event that only fields that do something during render are specified

I'm not sure I understand this use case as it seems like a very exotic edge case, can you elaborate on whether this is an issue worth solving?

As the issue is only upvoted once I'm (perhaps optimistically) assuming this is not a widespread problem.

github-actions[bot] commented 1 year ago

Stale issue message