Home > Symfony 1.3 & 1.4 > Batch Delete Doctrine_Connection_Mysql_Exception

Batch Delete Doctrine_Connection_Mysql_Exception

Symfony 1.4 wasn’t properly deleting records using a batch action delete. This is caused by the sfDoctrineChoice validator doClean.

line 98 of lib/plugins/sfDoctrinePlugin/lib/validator/sfDoctrineChoice.class.php

was:

$query->andWhere(sprintf(‘%s.%s = ?’, $query->getRootAlias(), $this->getColumn()), $value);

Patched to:

if (is_array($value))
{
$query->andWhereIn(sprintf(‘%s.%s’, $query->getRootAlias(), $this->getColumn()), $value);
}
else
{
$query->andWhere(sprintf(‘%s.%s = ?’, $query->getRootAlias(), $this->getColumn()), $value);
}

I’m not as familiar with the code but i’ve put in a bug request. http://trac.symfony-project.org/ticket/8271

Categories: Symfony 1.3 & 1.4 Tags:
  1. No comments yet.
  1. No trackbacks yet.