Cake 3.x Rules and messages

You were correct something in the styling is affecting this, I will look into this further Thanks so much !

1 Like

Actually what I found is it shows up when I am adding a new user but it does not show up when editing a new user. does the ->add mean that it only applies the rule on an add and it is not “adding” the rule to the validation

how do you mean? When you edit a record and try to put on an existing email than errors() is empty?

$user = $this->Users->get($id);

    if ($this->request->is('post')) {
        $this->Users->patchEntity($user, $this->request->getData());
        if ($this->Users->save($user)) {
            $this->Flash->success(__('Your user has been saved.'));
            return $this->redirect(['action' => 'index']);
        }
    }

$this->set(‘user’, $this->Users->get($id));

$this->set(‘user’, $this->Users->get($id)); -<-- the last line used to say this

but I changed to this $this->set(‘user’, $user); and this fixed my issue