Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manytomany string_agg: filter raise exception #702

Closed
FredDut opened this issue Mar 23, 2015 · 3 comments
Closed

manytomany string_agg: filter raise exception #702

FredDut opened this issue Mar 23, 2015 · 3 comments
Milestone

Comments

@FredDut
Copy link
Contributor

FredDut commented Mar 23, 2015

Hello,
I've a manytomany relation (postgres db) and I use string_agg, as mentioned in another issue.
In my entity, I have
@grid\Source(columns="id, nom, telephone, mel, sites.nom:string_agg:_", groupBy={"id"}, filterable=true)
The grid shows the column, but if I try to filter, I get this exception:

An exception occurred while executing 'SELECT s0_.id AS id0, s0_.nom AS nom1, s0_.telephone > AS telephone2, s0_.mel AS mel3, string_agg(s1_.nom, '') AS sclr4 FROM structure s0 LEFT JOIN sites_structures s2_ ON s0_.id = s2_.id_structure LEFT JOIN site s1_ ON s1_.id = s2_.id_site GROUP BY s0_.id HAVING sclr4 = ? LIMIT 10' with params ["Paris"]:

SQLSTATE[42703]: Undefined column: 7 ERROR: column "sclr4" does not exist
LINE 1: ...1_ ON s1_.id = s2_.id_site GROUP BY s0_.id HAVING sclr4 = $1...

Aren't string_agg columns filterables?

In another context, if I try to filter the data with setData before rendering the grid I get

FatalErrorException: Error: Class 'Symfony\Component\Form\Exception\PropertyAccessDeniedException' not found in /myproject/vendor/apy/datagrid-bundle/Grid/Source/Source.php line 212

There are two problems: the PropertyAccessDeniedException removed in SF 2.3 and the string_agg problem.

@Abhoryo
Copy link
Member

Abhoryo commented May 10, 2015

Check your doctrine version. I think you should have at least the 2.5 version.

If you know what exception we can use instead, you can make a PR. Thanks.

@FredDut
Copy link
Contributor Author

FredDut commented Jun 11, 2015

Hello,

I run an SF2.3 updated version with

doctrine/annotations v1.2.4
doctrine/cache v1.4.1
doctrine/collections v1.3.0
doctrine/common v2.5.0
doctrine/data-fixtures v1.1.1
doctrine/dbal v2.4.4
doctrine/doctrine-bundle v1.5.0
doctrine/doctrine-cache-bundle v1.0.1
doctrine/doctrine-fixtures-bundle v2.2.0
doctrine/inflector v1.0.1
doctrine/lexer v1.0.1
doctrine/orm v2.4.7

What part of doctrine should be in 2.5? common, orm, dbal?

Thanks

@FredDut
Copy link
Contributor Author

FredDut commented Jul 28, 2015

Hello ,
I finally upgrade to SF 2.7 and doctrine 2.5.
But the error when I try filter remains:

An exception occurred while executing 'SELECT s0_.id AS id_0, s0_.nom AS nom_1, s0_.telephone AS telephone_2, s0_.mel AS mel_3, string_agg(s1_.nom, '') AS sclr_4 FROM structure s0 LEFT JOIN sites_structures s2_ ON s0_.id = s2_.id_structure LEFT JOIN site s1_ ON s1_.id = s2_.id_site GROUP BY s0_.id HAVING sclr_4 = ? ORDER BY s0_.nom ASC LIMIT 10' with params ["an"]:

SQLSTATE[42703]: Undefined column: 7 ERREUR: la colonne « sclr_4 » n'existe pas
LINE 1: ...1_ ON s1_.id = s2_.id_site GROUP BY s0_.id HAVING sclr_4 = $...

Any idea?
Best regards

@hmert hmert modified the milestone: 2.3 Dec 13, 2015
@hmert hmert added the Bug label Dec 14, 2015
@hmert hmert added Unreproduced bug and removed Bug labels Oct 2, 2016
@hmert hmert closed this as completed Oct 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants