]> git.agnieray.net Git - galette.git/commitdiff
Make sure tmp_path is set when we create a new id
authorJohan Cwiklinski <johan@x-tnd.be>
Sat, 9 Nov 2013 08:48:47 +0000 (09:48 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Sat, 9 Nov 2013 08:48:47 +0000 (09:48 +0100)
Attachments can be removed on mailing cancel ths way.

galette/lib/Galette/Core/Mailing.php

index 638021334081ffa031c9d6188c93dda3a9a69f90..ba84c3e7d2c2070933c4f85b8ef57fa9cd9d6f1d 100644 (file)
@@ -108,6 +108,7 @@ class Mailing extends GaletteMail
     {
         $pass = new Password();
         $this->_id = $pass->makeRandomPassword(30);
+        $this->_tmp_path = GALETTE_ATTACHMENTS_PATH . '/' . $this->_id;
     }
 
     /**
@@ -259,8 +260,6 @@ class Mailing extends GaletteMail
      */
     public function store($files)
     {
-        $this->_tmp_path = GALETTE_ATTACHMENTS_PATH . '/' . $this->_id;
-
         if ( !file_exists($this->_tmp_path) ) {
             //directory does not exists, create it
             mkdir($this->_tmp_path);