DDC-3875: Warning: spl_object_hash() expects parameter 1 to be object, null given #4743

Open
opened 2026-01-22 14:48:39 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 21, 2015).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user syagr:

!http://joxi.ru/vAWypEBsPYZjmW.jpg!

I use Symfony 2.7 And when I used sonata admin with code below got this error.
->add('menuToItem', 'sonata_type_collection',

My code:
array('label' => 'Items', 'by_reference' => false),
array(
'edit' => 'inline',
'inline' => 'table',
'sortable' => 'position',
)
)
;

When I replaced code bellow in file UnitOfWork.php all became okay.

from
public function cancelOrphanRemoval($entity)
{
unset($this->orphanRemovals[spl_object_hash($entity)]);
}

to

public function cancelOrphanRemoval($entity)
{
if($entity)
unset($this->orphanRemovals[spl_object_hash($entity)]);
}

Can you add this fix?

Originally created by @doctrinebot on GitHub (Aug 21, 2015). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user syagr: !http://joxi.ru/vAWypEBsPYZjmW.jpg! I use Symfony 2.7 And when I used sonata admin with code below got this error. ->add('menuToItem', 'sonata_type_collection', My code: array('label' => 'Items', 'by_reference' => false), array( 'edit' => 'inline', 'inline' => 'table', 'sortable' => 'position', ) ) ; When I replaced code bellow in file UnitOfWork.php all became okay. from public function cancelOrphanRemoval($entity) { unset($this->orphanRemovals[spl_object_hash($entity)]); } to public function cancelOrphanRemoval($entity) { if($entity) unset($this->orphanRemovals[spl_object_hash($entity)]); } Can you add this fix?
admin added the Bug label 2026-01-22 14:48:39 +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#4743