Author: garak
Date: 2010-09-03 16:21:45 +0200 (Fri, 03 Sep 2010)
New Revision: 30818

Modified:
   plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAsset.php
   
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAssetFolder.php
   
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.de.xml
   
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.fr.xml
   
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.it.xml
   
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/templates/_messages.php
Log:
[sfAssetsLibraryPlugin] added a check for file correctly saved. Closes #4010


Modified: 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAsset.php
===================================================================
--- 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAsset.php   
    2010-09-03 13:42:27 UTC (rev 30817)
+++ 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAsset.php   
    2010-09-03 14:21:45 UTC (rev 30818)
@@ -113,7 +113,7 @@
     // calculate asset properties
     if (!$this->getFilename())
     {
-      list (, $filename) = sfAssetsLibraryTools::splitPath($assetPath);
+      list(, $filename) = sfAssetsLibraryTools::splitPath($assetPath);
       $this->setFilename($filename);
     }
 
@@ -135,14 +135,11 @@
       throw new sfAssetException('Filetype "%type%" not allowed', 
array('%type%' => $this->getType()));
     }
 
-    if ($move)
+    $ok = $move ? @rename($assetPath, $this->getFullPath()) : 
@copy($assetPath, $this->getFullPath());
+    if (!$ok)
     {
-      rename($assetPath, $this->getFullPath());
+      throw new sfAssetException('A problem occurred during while saving 
"%file%"', array('%file%' =>  $this->getFullPath()));
     }
-    else
-    {
-      copy($assetPath, $this->getFullPath());
-    }
 
     if ($this->supportsThumbnails())
     {

Modified: 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAssetFolder.php
===================================================================
--- 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAssetFolder.php
 2010-09-03 13:42:27 UTC (rev 30817)
+++ 
plugins/sfAssetsLibraryPlugin/branches/1.3/lib/model/plugin/PluginsfAssetFolder.php
 2010-09-03 14:21:45 UTC (rev 30818)
@@ -83,7 +83,8 @@
    */
   public function create()
   {
-    list ($base, $name ) = 
sfAssetsLibraryTools::splitPath($this->getRelativePath());
+    list ($base, $name) = 
sfAssetsLibraryTools::splitPath($this->getRelativePath());
+
     return sfAssetsLibraryTools::mkdir($name, $base);
   }
 

Modified: 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.de.xml
===================================================================
--- 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.de.xml  
    2010-09-03 13:42:27 UTC (rev 30817)
+++ 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.de.xml  
    2010-09-03 14:21:45 UTC (rev 30818)
@@ -212,7 +212,7 @@
         <target>Die Datei wurde verschoben</target>
       </trans-unit>
       <trans-unit>
-        <source>A problem occurren: The file has not been moved</source>
+        <source>A problem occurred: The file has not been moved</source>
         <target>Ein Problem ist aufgetreten: die Datei konnte nicht verschoben 
werden</target>
       </trans-unit>
       <trans-unit>
@@ -221,9 +221,13 @@
       </trans-unit>
       <trans-unit>
         <source>A problem occurred: The file has not been renamed</source>
-        <target>Ein Problem ist aufgetreten: Die Datei konnte nicht umbenannt 
werden</target>
+        <target>Ein Problem ist aufgetreten: die Datei konnte nicht 
gespeichert werden</target>
       </trans-unit>
       <trans-unit>
+        <source>A problem occurred during while saving "%file%"</source>
+        <target>Ein Problem ist aufgetreten: Die Datei "%file%"" konnte nicht 
umbenannt werden</target>
+      </trans-unit>
+      <trans-unit>
         <source>Asset "%asset%" not found</source>
         <target>Die Datei "%asset%" konnte nicht gefunden werden</target>
       </trans-unit>

Modified: 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.fr.xml
===================================================================
--- 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.fr.xml  
    2010-09-03 13:42:27 UTC (rev 30817)
+++ 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.fr.xml  
    2010-09-03 14:21:45 UTC (rev 30818)
@@ -212,7 +212,7 @@
         <target>Le fichier a bien été déplacé</target>
       </trans-unit>
       <trans-unit>
-        <source>A problem occurren: The file has not been moved</source>
+        <source>A problem occurred: The file has not been moved</source>
         <target>Le fichier n'a pas pu être déplacé</target>
       </trans-unit>
       <trans-unit>
@@ -224,6 +224,10 @@
         <target>Le fichier n'a pas pu être renommé</target>
       </trans-unit>
       <trans-unit>
+        <source>A problem occurred during while saving "%file%"</source>
+        <target>Le fichier "%file%" n'a pas pu être mis à jour</target>
+      </trans-unit>
+      <trans-unit>
         <source>Asset "%asset%" not found</source>
         <target>Le fichier "%asset%" n'a pas été trouvé</target>
       </trans-unit>

Modified: 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.it.xml
===================================================================
--- 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.it.xml  
    2010-09-03 13:42:27 UTC (rev 30817)
+++ 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/i18n/sfAsset.it.xml  
    2010-09-03 14:21:45 UTC (rev 30818)
@@ -212,7 +212,7 @@
         <target>Il file è stato spostato</target>
       </trans-unit>
       <trans-unit>
-        <source>A problem occurren: The file has not been moved</source>
+        <source>A problem occurred: The file has not been moved</source>
         <target>Errore durante lo spostamento del file</target>
       </trans-unit>
       <trans-unit>
@@ -224,6 +224,10 @@
         <target>Errore durante la rinomina del file</target>
       </trans-unit>
       <trans-unit>
+        <source>A problem occurred during while saving "%file%"</source>
+        <target>Errore durante il salvataggio del file "%file%"</target>
+      </trans-unit>
+      <trans-unit>
         <source>Asset "%asset%" not found</source>
         <target>Elemnto "%asset%" non trovato</target>
       </trans-unit>

Modified: 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/templates/_messages.php
===================================================================
--- 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/templates/_messages.php
  2010-09-03 13:42:27 UTC (rev 30817)
+++ 
plugins/sfAssetsLibraryPlugin/branches/1.3/modules/sfAsset/templates/_messages.php
  2010-09-03 14:21:45 UTC (rev 30818)
@@ -8,6 +8,7 @@
 </div>
 <?php elseif ($sf_user->hasFlash('warning_message') && 
$sf_user->hasFlash('warning_params')): ?>
 <div class="warning">
-<h2><?php echo __($sf_user->getFlash('warning_message', null, ESC_RAW), 
$sf_user->getFlash('warning_params', null, ESC_RAW), 'sfAsset') ?></h2>
+<?php $params =  $sf_user->getFlash('warning_params'); $params = $params 
instanceof sfOutputEscaper ? $params->getRawValue() : $params ?>
+<h2><?php echo __($sf_user->getFlash('warning_message', null, ESC_RAW), 
$params, 'sfAsset') ?></h2>
 </div>
 <?php endif ?>

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to