[PR #849] [MERGED] Error with Same Field, Multiple Values, Criteria and QueryBuilder #8796

Open
opened 2026-01-22 16:01:46 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/849
Author: @bsahlhof
Created: 11/18/2013
Status: Merged
Merged: 11/26/2013
Merged by: @guilhermeblanco

Base: masterHead: master


📝 Commits (2)

  • c2997b3 Add ability to test same parameter name for multiple values.
  • 96fb0d7 Changed logic to allow joining games, and becoming friends

📊 Changes

2 files changed (+21 additions, -2 deletions)

View changed files

📝 lib/Doctrine/ORM/Query/QueryExpressionVisitor.php (+8 -0)
📝 tests/Doctrine/Tests/ORM/QueryBuilderTest.php (+13 -2)

📄 Description

I just posted another quick patch for this, but after reviewing some of the tests, I realized I needed to change it slightly.

The bug appeared when using same field for 2 different expression values within Criteria, then adding to QueryBuilder.

This makes sure the parameters are unique, avoiding the issue.

Example of issue:
Criteria of Field1 = Value1 OR (Field1 = Value2 AND field2 = true) passed to QueryBuilder
In this case, the parameter :Field1 was duplicated, throwing an error on evaluation of DQL.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/849 **Author:** [@bsahlhof](https://github.com/bsahlhof) **Created:** 11/18/2013 **Status:** ✅ Merged **Merged:** 11/26/2013 **Merged by:** [@guilhermeblanco](https://github.com/guilhermeblanco) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`c2997b3`](https://github.com/doctrine/orm/commit/c2997b39611a370a631a09b74c7ef75a78885aa4) Add ability to test same parameter name for multiple values. - [`96fb0d7`](https://github.com/doctrine/orm/commit/96fb0d7e1429d6afafe0dde3ed6ccc502e7c9cc1) Changed logic to allow joining games, and becoming friends ### 📊 Changes **2 files changed** (+21 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/Query/QueryExpressionVisitor.php` (+8 -0) 📝 `tests/Doctrine/Tests/ORM/QueryBuilderTest.php` (+13 -2) </details> ### 📄 Description I just posted another quick patch for this, but after reviewing some of the tests, I realized I needed to change it slightly. The bug appeared when using same field for 2 different expression values within Criteria, then adding to QueryBuilder. This makes sure the parameters are unique, avoiding the issue. Example of issue: Criteria of Field1 = Value1 OR (Field1 = Value2 AND field2 = true) passed to QueryBuilder In this case, the parameter :Field1 was duplicated, throwing an error on evaluation of DQL. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 16:01:46 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#8796