Good afternoon! Help please. I have a (add) function in cakephp web application to add a project, that is, another line is added to the database in the table, the problem is that when filling in the form for a new project, empty fields are entered as an empty value in the database, although and the condition was set:
if(empty($this->request->data['Offer_Faktura_LBU']['kommentar'])) { $this->request->data['Offer_Faktura_LBU']['kommentar'] = null; } $this->Offer_Faktura_LBU->save($this->request->data); The paradox is that when I added a new project, and I want to change it (the edit function), then when I save this time, the empty fields change to null. Where the error lies is not clear, maybe in the CAKE library in the save function?