Fix intervention update sql error (#33916)
This commit is contained in:
parent
c55138f314
commit
55530fa588
2 changed files with 24 additions and 1 deletions
|
|
@ -448,7 +448,7 @@ class Fichinter extends CommonObject
|
|||
$sql .= ", date_valid = ".($this->datev ? "'".$this->db->idate($this->datev)."'" : "null");
|
||||
}
|
||||
if (isset($this->datet)) {
|
||||
$sql .= ", datet = '".($this->datet ? "'".$this->db->idate($this->datet)."'" : "null");
|
||||
$sql .= ", datet = ".($this->datet ? "'".$this->db->idate($this->datet)."'" : "null");
|
||||
}
|
||||
$sql .= ", note_private = ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null");
|
||||
$sql .= ", note_public = ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null");
|
||||
|
|
|
|||
|
|
@ -104,6 +104,29 @@ class FichinterTest extends CommonClassTest
|
|||
return $localobject;
|
||||
}
|
||||
|
||||
/**
|
||||
* testFichinterUpdate
|
||||
*
|
||||
* Check that a intervention object can be updated.
|
||||
*
|
||||
* @param Object $localobject An existing intervention object to update.
|
||||
* @return Intervention object with data fetched and description changed
|
||||
*
|
||||
* @depends testFichinterFetch
|
||||
*/
|
||||
public function testFichinterUpdate($localobject)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$localobject->description = "foobar";
|
||||
|
||||
$result = $localobject->update($user);
|
||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0, $localobject->errorsToString());
|
||||
|
||||
return $localobject;
|
||||
}
|
||||
|
||||
/**
|
||||
* testFichinterValid
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue