Skip to content

Commit

Permalink
Revert "Added missing generateErrorRedirect() calls"
Browse files Browse the repository at this point in the history
This reverts commit fe03294.
  • Loading branch information
roadster31 committed Jan 8, 2016
1 parent 644ce4e commit 96c6fa1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
9 changes: 2 additions & 7 deletions local/modules/Front/Controller/AddressController.php
Expand Up @@ -32,7 +32,6 @@
use Thelia\Form\AddressUpdateForm;
use Thelia\Form\Definition\FrontForm;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Log\Tlog;
use Thelia\Model\AddressQuery;

/**
Expand Down Expand Up @@ -143,7 +142,7 @@ public function processUpdateAction($address_id)
$request = $this->getRequest();

$addressUpdate = $this->createForm(FrontForm::ADDRESS_UPDATE);

$message = false;
try {
$customer = $this->getSecurityContext()->getCustomerUser();

Expand All @@ -170,11 +169,9 @@ public function processUpdateAction($address_id)
} catch (\Exception $e) {
$message = $this->getTranslator()->trans("Sorry, an error occured: %s", ['%s' => $e->getMessage()], Front::MESSAGE_DOMAIN);
}

$this->getParserContext()->set("address_id", $address_id);

if ($message !== false) {
Tlog::getInstance()->error(sprintf("Error during address creation process : %s", $message));
\Thelia\Log\Tlog::getInstance()->error(sprintf("Error during address creation process : %s", $message));

$addressUpdate->setErrorMessage($message);

Expand All @@ -183,8 +180,6 @@ public function processUpdateAction($address_id)
->setGeneralError($message)
;
}

return $this->generateErrorRedirect($addressUpdate);
}

public function deleteAction($address_id)
Expand Down
5 changes: 3 additions & 2 deletions local/modules/Front/Controller/CartController.php
Expand Up @@ -82,8 +82,6 @@ public function addItem()
$cartAdd->setErrorMessage($message);
$this->getParserContext()->addForm($cartAdd);
}

return $this->generateErrorRedirect($cartAdd);
}

public function changeItem()
Expand All @@ -106,9 +104,12 @@ public function changeItem()
} elseif (null !== $response = $this->generateSuccessRedirect()) {
return $response;
}


} catch (PropelException $e) {
$this->getParserContext()->setGeneralError($e->getMessage());
}

}

public function deleteItem()
Expand Down
2 changes: 0 additions & 2 deletions local/modules/Front/Controller/CouponController.php
Expand Up @@ -144,7 +144,5 @@ public function consumeAction()
->addForm($couponCodeForm)
->setGeneralError($message);
}

return $this->generateErrorRedirect($couponCodeForm);
}
}
2 changes: 0 additions & 2 deletions local/modules/Front/Controller/CustomerController.php
Expand Up @@ -490,8 +490,6 @@ public function loginAction()
$customerLoginForm->setErrorMessage($message);

$this->getParserContext()->addForm($customerLoginForm);

return $this->generateErrorRedirect($customerLoginForm);
}
}

Expand Down

0 comments on commit 96c6fa1

Please sign in to comment.