|
@@ -367,14 +367,14 @@ class CRUDController extends Controller
|
|
|
{
|
|
|
$url = false;
|
|
|
|
|
|
- if ($this->get('request')->get('btn_update_and_list')) {
|
|
|
+ if (null !== $this->get('request')->get('btn_update_and_list')) {
|
|
|
$url = $this->admin->generateUrl('list');
|
|
|
}
|
|
|
- if ($this->get('request')->get('btn_create_and_list')) {
|
|
|
+ if (null !== $this->get('request')->get('btn_create_and_list')) {
|
|
|
$url = $this->admin->generateUrl('list');
|
|
|
}
|
|
|
|
|
|
- if ($this->get('request')->get('btn_create_and_create')) {
|
|
|
+ if (null !== $this->get('request')->get('btn_create_and_create')) {
|
|
|
$params = array();
|
|
|
if ($this->admin->hasActiveSubClass()) {
|
|
|
$params['subclass'] = $this->get('request')->get('subclass');
|
|
@@ -521,11 +521,11 @@ class CRUDController extends Controller
|
|
|
|
|
|
// persist if the form was valid and if in preview mode the preview was approved
|
|
|
if ($isFormValid && (!$this->isInPreviewMode() || $this->isPreviewApproved())) {
|
|
|
-
|
|
|
+
|
|
|
if (false === $this->admin->isGranted('CREATE', $object)) {
|
|
|
throw new AccessDeniedException();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$this->admin->create($object);
|
|
|
|
|
|
if ($this->isXmlHttpRequest()) {
|