Kaynağa Gözat

Add translation name parameter to flash_create_error message

Mark Wilson 11 yıl önce
ebeveyn
işleme
08c17cdeba
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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