Permalink
Browse files

Optimized reloading for batchDelete - do not reload first object sinc…

…e there were no changes yet
  • Loading branch information...
1 parent a5ec235 commit 302a06d517a50cd57837b6857378caebed907784 @rozwell rozwell committed Feb 29, 2012
@@ -53,7 +53,7 @@ protected function executeBatchDelete(sfWebRequest $request)
$this->dispatcher->notify(new sfEvent($this, 'admin.delete_object', array('object' => $object)));
// reload the object if it's in a tree to avoid breaking nested set structure
- if (method_exists($object, 'isInTree') && $object->isInTree())
+ if ($count && method_exists($object, 'isInTree') && $object->isInTree())
{
$object->reload();
}
@@ -53,7 +53,7 @@ protected function executeBatchDelete(sfWebRequest $request)
$this->dispatcher->notify(new sfEvent($this, 'admin.delete_object', array('object' => $object)));
// reload the object if it's in a tree to avoid breaking nested set structure
- if (method_exists($object, 'isInTree') && $object->isInTree())
+ if ($count && method_exists($object, 'isInTree') && $object->isInTree())
{
$object->reload();
}

0 comments on commit 302a06d

Please sign in to comment.