# Validation not working cakephp 4.4.16

**URL:** <https://discourse.cakephp.org/t/validation-not-working-cakephp-4-4-16/11455>\
**Category:** Uncategorized\
**Created:** [August 21, 2023, 5:41am UTC](https://discourse.cakephp.org/t/validation-not-working-cakephp-4-4-16/11455 "2023-08-21T05:41:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaan007](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/shaan007/32/2765_2.png) [@shaan007](https://discourse.cakephp.org/u/shaan007)\
**Post date:** [August 21, 2023, 5:41am UTC](https://discourse.cakephp.org/t/validation-not-working-cakephp-4-4-16/11455/1 "2023-08-21T05:41:06Z")

</div>

![Screenshot from 2023-08-21 11-07-10](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/9/9ac0a3a8b01bf2e18629834edc4415500044ddec.png)  
 ![Screenshot from 2023-08-21 11-08-03](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/f/fd9bbb3ae92ba70464060e73da332baee54be8da.png)  
 ![Screenshot from 2023-08-21 11-09-03](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/c/ca50426be0ba780e6055cb40511833446c1503d9.png)

---

<div class="post-metadata">

**Author:** ![Mentis](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mentis/32/994_2.png) [@Mentis](https://discourse.cakephp.org/u/Mentis)\
**Post date:** [August 21, 2023, 4:26pm UTC](https://discourse.cakephp.org/t/validation-not-working-cakephp-4-4-16/11455/2 "2023-08-21T16:26:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shaan007](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/shaan007/32/2765_2.png) [@shaan007](https://discourse.cakephp.org/u/shaan007)\
**Post date:** [August 21, 2023, 4:39pm UTC](https://discourse.cakephp.org/t/validation-not-working-cakephp-4-4-16/11455/3 "2023-08-21T16:39:48Z")

</div>

sure bro…  
ProfileTable

 ![Screenshot from 2023-08-21 22-08-37](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/e/e9076465867f5183269e154bb1ae321097d6e059.png)

UsersTable

 ![Screenshot from 2023-08-21 22-08-23](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/b/b0000226d39c2f42fa16cc6995ffda6238031888.png)

---

<div class="post-metadata">

**Author:** ![Mentis](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mentis/32/994_2.png) [@Mentis](https://discourse.cakephp.org/u/Mentis)\
**Post date:** [August 21, 2023, 5:03pm UTC](https://discourse.cakephp.org/t/validation-not-working-cakephp-4-4-16/11455/4 "2023-08-21T17:03:06Z")

</div>

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.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/5/52e2ceeaae12480668bb2b7cfc743435bae35d38.png)

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/8/8b977bc5e56640a6e097ce9f726c0b565e1af9e9.png)

---

<div class="post-metadata">

**Author:** ![shaan007](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/shaan007/32/2765_2.png) [@shaan007](https://discourse.cakephp.org/u/shaan007)\
**Post date:** [August 22, 2023, 4:26am UTC](https://discourse.cakephp.org/t/validation-not-working-cakephp-4-4-16/11455/5 "2023-08-22T04:26:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shaan007](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/shaan007/32/2765_2.png) [@shaan007](https://discourse.cakephp.org/u/shaan007)\
**Post date:** [August 22, 2023, 5:12am UTC](https://discourse.cakephp.org/t/validation-not-working-cakephp-4-4-16/11455/6 "2023-08-22T05:12:14Z")

</div>

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

 ![Screenshot from 2023-08-22 10-40-47](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/c/ca196f478e0e325905dd8d9026ca661e227931f7.png)

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

---

<div class="post-metadata">

**Author:** ![shaan007](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/shaan007/32/2765_2.png) [@shaan007](https://discourse.cakephp.org/u/shaan007)\
**Post date:** [August 22, 2023, 6:14am UTC](https://discourse.cakephp.org/t/validation-not-working-cakephp-4-4-16/11455/7 "2023-08-22T06:14:01Z")

</div>

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

Configure::write(‘MixerApi.ExceptionRender.entity\_validation’, false);
