From 182e3a63b014bf0a067966dd124215e73ba9718b Mon Sep 17 00:00:00 2001 From: "Alfonso Saavedra \"Son Link" Date: Thu, 19 Dec 2024 17:04:01 +0100 Subject: [PATCH] Fixed a problem when moving and adding the user's avatar in the registry --- app/Models/UsersModel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/UsersModel.php b/app/Models/UsersModel.php index 197685d..21ad12c 100644 --- a/app/Models/UsersModel.php +++ b/app/Models/UsersModel.php @@ -420,8 +420,8 @@ class UsersModel extends BaseModel //$builder->resetQuery(); // Move the file to it's new home $filename = $user['username'] . '.' . $image->getExtension(); - $image->move(FCPATH . '/img/users/', $filename); - $this->where('id', $id)->update(['img' => $filename]); + $image->move(ROOTPATH . '/public/img/users/', $filename);$image->move(ROOTPATH . '/public/img/users/', $filename, true); + $this->where('id', $id)->set(['img' => $filename])->update(); $response['ok'] = true; } }