Browse Source

Add translation name parameter to flash_create_error message

Mark Wilson 11 năm trước cách đây
mục cha
commit
08c17cdeba
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Controller/CRUDController.php

+ 1 - 1
Controller/CRUDController.php

@@ -529,7 +529,7 @@ class CRUDController extends Controller
             // show an error message if the form failed validation
             if (!$isFormValid) {
                 if (!$this->isXmlHttpRequest()) {
-                    $this->addFlash('sonata_flash_error', 'flash_create_error');
+                    $this->addFlash('sonata_flash_error', $this->admin->trans('flash_create_error', array('%name%' => $this->admin->toString($object)), 'SonataAdminBundle'));
                 }
             } elseif ($this->isPreviewRequested()) {
                 // pick the preview template if the form was valid and preview was requested