I can edit all fields together, but I cannot edit any field individually. (cakephp4.4)

Hi, I have a flying problem and can’t figure out what it is. I have an editUser method for the table User. The table user has a left join against the table Profile. In the table Profile I have the fields: userUuid, image, tags and describtion. And now to my problem. I can edit all fields together and generate revised entries in the table, but I cannot edit any field individually. Then an error occurs in my method. Here is my controller for a better understanding:

public function editUser($userUuid = null) {

        $associated = ['Profiles','Settings'];
        $user = $this->Users->get($userUuid, [
            'contain' => $associated
        ]);

        $uploadPath =  WWW_ROOT . DS .'shared' . DS . 'upload'. DS ;

        if ($this->request->is(['patch', 'post', 'put'])) {
            $requestData = $this->request->getData();
            $user = $this->Users->patchEntity($user, $requestData);
            $image =  $this->request->getUploadedFile('profile.image');
            var_dump($image->getError());
            if(isset($image) && $image->getError() !== UPLOAD_ERR_NO_FILE){
                $name = $image->getClientFilename();
                $targetPath =  $uploadPath . $name;
                $image->moveTo($targetPath);
                $user->profile->image = '/shared/upload/' . $name;
            }else{
                log::error("File upload error: " . $image->getError());
            }
            if ($this->Users->save($user)) {
                log::debug((string)$user);
                $this->Flash->success(__('The user has been saved.'));
                return $this->redirect(['controller' => 'Dashboards', 'action' => 'index', $userUuid]);
            } else {
                log::error((string)$user);
                $this->Flash->error(__('The user could not be saved. Please try again.'));
            }
        }
        $this->set(compact('user'));
    }

And my Profile table Class:

class ProfilesTable extends Table
{
  public function initialize(array $config): void {

          parent::initialize($config);

          $this->setTable('profiles');
          $this->setDisplayField('id');
          $this->setPrimaryKey('id');
          $this->belongsTo('Users', [
              'foreignKey' => 'userUuid'
          ]);
        $this->hasOne('Settings', [
            'foreignKey' => 'userUuid'
        ]);
    }


    public function validationDefault(Validator $validator): Validator
    {
        $validator
            ->scalar('userUuid')
            ->maxLength('userUuid', 255)
            ->allowEmptyString('userUuid')
            ->add('userUuid', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);

        $validator
            ->scalar('image')
            ->allowEmptyArray('image');

        $validator
            ->scalar('tags')
            ->maxLength('tags', 245)
            ->allowEmptyString('tags');

        $validator
            ->scalar('description')
            ->allowEmptyString('description');

        return $validator;
    }
}

Thanks for any advice

It would be extremely helpful to tell us what error you get.

sorry, i forgot:

2024-02-21 20:03:59 error: File upload error: 4
2024-02-21 20:03:59 error: {
    "id": 43,
    "name": "Name",
    "lastname": "Whatever",
    "username": "Whatever",
    "email": "test@test.de",
    "userUuid": "b213d53f-5d8c-49d3-bf1d-3ab115ffabb7",
    "setting": {
        "id": 3,
        "userUuid": "b213d53f-5d8c-49d3-bf1d-3ab115ffabb7",
        "headline_color": null,
        "text_color": null,
        "link_color": null,
        "background_image": null
    },
    "profile": {
        "id": 32,
        "userUuid": "b213d53f-5d8c-49d3-bf1d-3ab115ffabb7",
        "image": "\/shared\/upload\/logo.jpg",
        "tags": "Tags",
        "description": "This is a dummy text here a user can write up to 255 characters Test"
    }

Can you add log::error(print_r($user->getErrors(), true)); when it fails to save?