Validation not working cakephp 4.4.16



Can you share your UsersTable and ProfilesTable files, and possibly your SQL schema? Your associations might not be set up correctly.

sure bro…
ProfileTable

UsersTable

I see you are using Mixer API, which I am unfamiliar with. I set up a fresh app without Mixer API and mirrored your files. Both user and profile were saved successfully.

I’d look into the following file for why it is throwing the exception: vendor/mixerapi/exception-render/src/EntityValidationListener.php. If you can’t find the reason there, look further down the stack trace (left hand side of your first image in the original post).

If you have xdebug installed, you can follow the code from start to exception, using breakpoints.

Edit: Optionally, you can add dd($user) beneath patchEntity to see if there are any errors in the entity. If no errors, you can try to add dd($user) beneath save($user). See image attached. However, I think the error you see happens during the save process, doing the dd() under save will likely not help anything.

thank man, Actually if i would fill all the fields then data saved into the table but the problem is that when i left empty all fields then it would throw error… but i want to show validation message in my view file under the input field but it does not work, so please help if you have any idea bro

Bro i want to like this where error message show under the field…

Yes you are right i think, because this app is not using MIXER API that’s why its throw error message under fields

issue solved bro by myself hehhehehhe… I just put this code and get exact what i want!

Configure::write(‘MixerApi.ExceptionRender.entity_validation’, false);