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

bugfix-2838-searchfilter-custom-types #2873

Conversation

farazive
Copy link

Added support for doctrine types in ORM SearchFilter.

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? same as branch 2.4
Fixed tickets #2838
License MIT
Doc PR N/A

@dunglas
Copy link
Member

dunglas commented Jun 26, 2019

The test failure looks related to this patch. Could you try to fix the code?

@farazive
Copy link
Author

The test failure looks related to this patch. Could you try to fix the code?

will do

@rvmourik
Copy link

rvmourik commented Oct 4, 2019

Any idea when this is going to be available?

@farazive
Copy link
Author

farazive commented Oct 5, 2019

Terribly sorry guys, I haven't had the time to come back to this. Can someone pick this up please and fix the tests? Thanks.

@mleczakm
Copy link

mleczakm commented Nov 23, 2019

Any ETA or docs fix about this, because it is not documented that custom type ids are not supported in filters?

}

/**
* Adds where clause according to the strategy.
*
* @throws InvalidArgumentException If strategy does not exist
*/
protected function addWhereByStrategy(string $strategy, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, $value, bool $caseSensitive)
protected function addWhereByStrategy(string $strategy, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $field, $value, bool $caseSensitive, $doctrineType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BC: we cannot add a non-optional argument to a protected class method.

}
}

private function setOrClause(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, array $values, $alias, $field, $doctrineType, $caseSensitive)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This method should be removed.

{
$wrapCase = $this->createWrapCase($caseSensitive);
$orX = $queryBuilder->expr()->orX();
foreach ($values as $value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid dynamic queries like this.

@bettinz
Copy link

bettinz commented Jun 19, 2020

Hello, was it fixed on released brand or isn't fixed yet? Thanks 🙏

@yakobe
Copy link

yakobe commented Jul 8, 2020

It would be cool to get this in. Any help needed?

@alanpoulain
Copy link
Member

Same as #3774.
Had to be reverted (see #4134).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants