DDC-1130: unmanaged/detached object in where-part causes division by zero #1413

Open
opened 2026-01-22 13:13:37 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 29, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user mr:

As long as the clientGroup-parameter is an unmanaged/detached object the following code leads into a division by zero in "Query.php". I'm not sure if this is the right behavior or a bug?

function findClientByClientGroup(ClientGroup $clientGroup){
    $em = ApplicationContext::getEntityManager();
    $query = $em->createQuery('SELECT c FROM Client c WHERE c.clientGroup = :clientGroup');
    $query->setParameter("clientGroup", $clientGroup);
    $query->getResult();
}

findClientByClientGroup(new ClientGroup());
Originally created by @doctrinebot on GitHub (Apr 29, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user mr: As long as the clientGroup-parameter is an unmanaged/detached object the following code leads into a division by zero in "Query.php". I'm not sure if this is the right behavior or a bug? ``` function findClientByClientGroup(ClientGroup $clientGroup){ $em = ApplicationContext::getEntityManager(); $query = $em->createQuery('SELECT c FROM Client c WHERE c.clientGroup = :clientGroup'); $query->setParameter("clientGroup", $clientGroup); $query->getResult(); } findClientByClientGroup(new ClientGroup()); ```
admin added the Bug label 2026-01-22 13:13:37 +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#1413