Fix intervention update sql error (#33916)

This commit is contained in:
Francis Appels 2025-04-18 20:01:58 +02:00 committed by GitHub
parent c55138f314
commit 55530fa588
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View file

@ -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");

View file

@ -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
*