Fix var not defined

This commit is contained in:
Laurent Destailleur 2020-12-28 12:36:36 +01:00
parent 4b3cd947f2
commit 7c3688c66f
2 changed files with 4 additions and 1 deletions

View File

@ -499,7 +499,7 @@ if ($object->fetch($id) >= 0)
// Fix/update nbemail on emailing record if it differs (may happen if user edit lines from database directly)
if (empty($asearchcriteriahasbeenset)) {
if ($nbtotalofrecords != $object->email) {
if ($nbtotalofrecords != $object->nbemail) {
dol_syslog("We found a difference in nb of record in target table and the property ->nbemail, we fix ->nbemail");
//print "nbemail=".$object->nbemail." nbtotalofrecords=".$nbtotalofrecords;
$resultrefresh = $object->refreshNbOfTargets();

View File

@ -603,12 +603,15 @@ class Mailing extends CommonObject
if (! $resqlupdate) {
$this->error = $this->db->lasterror();
return -1;
} else {
$this->nbemail = (int) $nbforupdate;
}
}
} else {
$this->error = $this->db->lasterror();
return -1;
}
return 1;
}