Skip to content

Avoid to truncate WHERE clauses when clonning the querybuilder#1009

Closed
antograssiot wants to merge 1 commit into
api-platform:2.0from
antograssiot:2.0
Closed

Avoid to truncate WHERE clauses when clonning the querybuilder#1009
antograssiot wants to merge 1 commit into
api-platform:2.0from
antograssiot:2.0

Conversation

@antograssiot

Copy link
Copy Markdown
Contributor
Q A
Bug fix? yes
New feature? yes/no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

This PR aims to fix a bug introduced by #950
Actually when the querybuilder is cloned, some where parts are stripped.

The issue comes from

    // Change where aliases
    foreach ($wherePart->getParts() as $where) {
        $queryBuilderClone->add('where', str_replace($aliases, $replacements, $where));
    }

because the add() function doesn't append.

There's probably a cleaner way of fixing this, please let me know and i'll update

@antograssiot

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1010

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant