Skip to content

Commit

Permalink
Fix: ref was not set on object after renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jun 12, 2014
1 parent 8a9db28 commit 2edfcc2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions htdocs/comm/propal/class/propal.class.php
Expand Up @@ -1349,10 +1349,10 @@ function valid($user, $notrigger=0)
{
// Rename of propal directory ($this->ref = old ref, $num = new ref)
// to not lose the linked files
$facref = dol_sanitizeFileName($this->ref);
$snumfa = dol_sanitizeFileName($num);
$dirsource = $conf->propal->dir_output.'/'.$facref;
$dirdest = $conf->propal->dir_output.'/'.$snumfa;
$oldref = dol_sanitizeFileName($this->ref);
$newref = dol_sanitizeFileName($num);
$dirsource = $conf->propal->dir_output.'/'.$oldref;
$dirdest = $conf->propal->dir_output.'/'.$newref;
if (file_exists($dirsource))
{
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
Expand All @@ -1362,15 +1362,17 @@ function valid($user, $notrigger=0)

dol_syslog("Rename ok");
// Deleting old PDF in new rep
dol_delete_file($conf->propal->dir_output.'/'.$snumfa.'/'.$facref.'*.*');
dol_delete_file($conf->propal->dir_output.'/'.$newref.'/'.$oldref.'*.*');
}
}
}

$this->ref=$num;
$this->brouillon=0;
$this->statut = 1;
$this->user_valid_id=$user->id;
$this->datev=$now;

$this->db->commit();
return 1;
}
Expand Down

0 comments on commit 2edfcc2

Please sign in to comment.