DDC-1911: [GH-392] Replaced a shallow-copy with a deep-copy to avoid side effects. #2411

Closed
opened 2026-01-22 13:52:06 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 6, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @beberlei:

This issue is created automatically through a Github pull request on behalf of egeloen:

Url: https://github.com/doctrine/doctrine2/pull/392

Message:

Hey!

I'm currently using Symfony 2.1 Doctrine master branch Pager fanta master branch.

I'm facing a very vicious issue.

The doctrine paginator is able to clone a query with his cloneQuery method. This method will only clone the query without this parameters & hints. The issue is the parameters is setted with the setParameters method which will only affect the ArrayCollection reference to the new query builder and so, shared the reference between the two queries.

This PR will make a deep-copy of the ArrayCollection instead of a simple shallow-copy.

I'm not sure if this fix is the best solution.

Let me know if you need more information. :)

Originally created by @doctrinebot on GitHub (Jul 6, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @beberlei: This issue is created automatically through a Github pull request on behalf of egeloen: Url: https://github.com/doctrine/doctrine2/pull/392 Message: Hey! I'm currently using Symfony 2.1 <ins> Doctrine master branch </ins> Pager fanta master branch. I'm facing a very vicious issue. The doctrine paginator is able to clone a query with his `cloneQuery` method. This method will only clone the query without this parameters & hints. The issue is the parameters is setted with the `setParameters` method which will only affect the ArrayCollection reference to the new query builder and so, shared the reference between the two queries. This PR will make a deep-copy of the ArrayCollection instead of a simple shallow-copy. I'm not sure if this fix is the best solution. Let me know if you need more information. :)
admin added the Bug label 2026-01-22 13:52:06 +01:00
admin closed this issue 2026-01-22 13:52:10 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 8, 2012):

Comment created by @beberlei:

A related Github Pull-Request [GH-392] was closed
https://github.com/doctrine/doctrine2/pull/392

@doctrinebot commented on GitHub (Jul 8, 2012): Comment created by @beberlei: A related Github Pull-Request [GH-392] was closed https://github.com/doctrine/doctrine2/pull/392
Author
Owner

@doctrinebot commented on GitHub (Jul 8, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jul 8, 2012): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Oct 22, 2013):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-392] was closed:
https://github.com/doctrine/dbal/pull/392

@doctrinebot commented on GitHub (Oct 22, 2013): Comment created by @doctrinebot: A related Github Pull-Request [GH-392] was closed: https://github.com/doctrine/dbal/pull/392
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2411