failsafe on note update

This commit is contained in:
2020-02-24 23:46:46 +01:00
parent d4b274c685
commit 5eb1198409

View File

@@ -59,7 +59,7 @@ class Note extends PhpObject {
public function setNote($sNotes) {
$sError = '';
if($this->iUserId > 0 && $this->iCourseId > 0) {
if($this->iUserId > 0 && $this->iCourseId > 0 && $sNotes!='') {
$asData = array_merge($this->getNoteKeys(), array('notes'=>$sNotes));
$iNoteId = $this->oDb->insertUpdateRow(self::NOTE_TABLE, $asData, array_keys($this->getNoteKeys()));
if(!$iNoteId) $sError = $this->oDb->getLastError();