Open knallcharge opened 3 months ago
We're using the bundle ourselves on several projects with ORM 3.1 so no clue why your is special.
I would recommend dumping the constructed DQL at or around ((...)\vendor\omines\datatables-bundle\src\Adapter\Doctrine\ORMAdapter.php:191
to further debug what's happening here, it should be pretty clear from there.
Thanks for getting back! I found the cause - my bad, forgot to mention that I'm using SQL Server not mySQL and obviously SQL Server is not compatible with the partial-syntax this bundle is creating.
This would be a fix that works with SQL Server:
Replace
$qb->addSelect('partial ' . $key . '.{' . implode(',', $value) . '}');
in AutomaticQueryBuilder (line 139) with
$qb->addSelect($key);
but that will of course remove the "partial"-part from the query which may lead to huge resultsets with big tables when you only need some columns ... don't know if that's a good idea, even though it would work for my use case but it may lead to problems for others, what do you think?
@shades684 mentioned the PARTIAL
is technically obsolete as we iterate through cursors where available by default. I think we can just remove it, it's being deprecated in Doctrine as a whole.
It should be noted that the test suite currently does trigger this error when ORM 3.0+ is installed.
Parking this issue until https://github.com/doctrine/orm/issues/8471 is resolved, if they do reintroduce it in 3.2 we might as well keep it in (removing our partial logic is not trivial).
For now consider ORM 3.0/3.1 unsupported.
Stale issue message
Wake. 3.2 didn't get this yet but it's still intended to return in Doctrine.
Hi,
I tried updating my project to use doctrine/orm 3.1 today (from 2) and now I'm getting the following error:
"[Syntax Error] line 0, col 20: Error: Expected Doctrine\ORM\Query\TokenType::T_FROM, got '.'"
The datatable I'm using is pretty straightforward, this is my code:
I have tried to remove one column after the other to check whether that makes a difference, but it doesn't.
This is the full stacktrace:
Doctrine\ORM\Query\QueryException: [Syntax Error] line 0, col 20: Error: Expected Doctrine\ORM\Query\TokenType::T_FROM, got '.'
I tried to downgrade doctrine/orm to 3.0 but the error remains.