allow country update

This commit is contained in:
Manuel Raynaud
2013-10-10 14:20:53 +02:00
parent d8ec745fea
commit 6bfca2c6b4
9 changed files with 140 additions and 74 deletions

View File

@@ -246,7 +246,7 @@ class BaseAdminController extends BaseController
* @param unknown $routeId the route ID, as found in Config/Resources/routing/admin.xml
* @param unknown $urlParameters the URL parametrs, as a var/value pair array
*/
public function redirectToRoute($routeId, $urlParameters = array(), $routeParameters = array())
public function redirectToRoute($routeId, array $urlParameters = array(), array $routeParameters = array())
{
$this->redirect(URL::getInstance()->absoluteUrl($this->getRoute($routeId, $routeParameters), $urlParameters));
}

View File

@@ -129,7 +129,7 @@ class CountryController extends AbstractCrudController
*/
protected function getUpdateEvent($formData)
{
$event = new CountryUpdateEvent();
$event = new CountryUpdateEvent($formData['id']);
return $this->hydrateEvent($event, $formData);
}
@@ -139,6 +139,8 @@ class CountryController extends AbstractCrudController
$event
->setLocale($formData['locale'])
->setTitle($formData['title'])
->setChapo($formData['chapo'])
->setDescription($formData['description'])
->setIsocode($formData['isocode'])
->setIsoAlpha2($formData['isoalpha2'])
->setIsoAlpha3($formData['isoalpha3'])
@@ -236,7 +238,10 @@ class CountryController extends AbstractCrudController
*/
protected function redirectToEditionTemplate()
{
$this->redirectToRoute('admin.configuration.countries.update', array(), $this->getRequest()->get('country_id', 0));
$this->redirectToRoute('admin.configuration.countries.update', array(), array(
"country_id" => $this->getRequest()->get('country_id', 0)
)
);
}
/**