DirectorObjectForm: deletion check only when sent

This commit is contained in:
Thomas Gelf 2016-03-06 13:07:56 +01:00
parent cafd136232
commit 24f1580c92

View File

@ -619,12 +619,12 @@ abstract class DirectorObjectForm extends QuickForm
$values = array(); $values = array();
$object = $this->object(); $object = $this->object();
if ($this->hasBeenSent()) {
if ($this->shouldBeDeleted()) { if ($this->shouldBeDeleted()) {
$this->deleteObject($object); $this->deleteObject($object);
} }
if ($this->hasBeenSent()) {
$post = $this->getRequest()->getPost(); $post = $this->getRequest()->getPost();
foreach ($post as $key => $value) { foreach ($post as $key => $value) {
$el = $this->getElement($key); $el = $this->getElement($key);