Skip to content

bugfix-2838-searchfilter-custom-types - #2873

Closed
farazive wants to merge 3 commits into
api-platform:2.4from
farazive:bugfix-2838-searchfilter-custom-types
Closed

bugfix-2838-searchfilter-custom-types#2873
farazive wants to merge 3 commits into
api-platform:2.4from
farazive:bugfix-2838-searchfilter-custom-types

Conversation

@farazive

Copy link
Copy Markdown

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

dunglas commented Jun 26, 2019

Copy link
Copy Markdown
Member

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

@farazive

Copy link
Copy Markdown
Author

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

will do

@rvmourik

rvmourik commented Oct 4, 2019

Copy link
Copy Markdown

Any idea when this is going to be available?

@farazive

farazive commented Oct 5, 2019

Copy link
Copy Markdown
Author

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

mleczakm commented Nov 23, 2019

Copy link
Copy Markdown

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

* @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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

bettinz commented Jun 19, 2020

Copy link
Copy Markdown

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

@yakobe

yakobe commented Jul 8, 2020

Copy link
Copy Markdown

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

@alanpoulain

Copy link
Copy Markdown
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