# How to modify post request data (

**URL:** https://discourse.cakephp.org/t/how-to-modify-post-request-data/8252
**Category:** Site Feedback
**Created:** [August 21, 2020, 6:07am UTC](https://discourse.cakephp.org/t/how-to-modify-post-request-data/8252 "2020-08-21T06:07:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![njuejohn](https://avatars.discourse-cdn.com/v4/letter/n/ba9def/32.png) [@njuejohn](https://discourse.cakephp.org/u/njuejohn)
#### Post date: [August 21, 2020, 6:07am UTC](https://discourse.cakephp.org/t/how-to-modify-post-request-data/8252/1 "2020-08-21T06:07:15Z")

</div>

I am modifying request data as follows:

$data=$this-\>request-\>getData();  
$this-\>request-\>data[‘user\_name’] = $data[“userAccount”];  
$this-\>request-\>data[‘user\_pass’] = $data[“userPass”];  
$user = $this-\>Auth-\>identify();

I get the following warning:

[**Deprecated** (16384)](javascript:void(0);): Accessing `data` as a property will be removed in 4.0.0. Use request-\>getData() instead. - LoginController.php, line: 50 You can disable deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED` in your config/app.php. [ **CORE/src/Core/functions.php** , line **311**

Is there a way of overcoming this without disabling warnings and notices?

Regards.

Sorry! This thread resolved!!!

> [@Modify request-\>data from controller](https://discourse.cakephp.org/t/modify-request-data-from-controller/5232):
>
> Hi I need to modify the request-\>data from a controller to reflect adjustments in a form. E.g. modifying a number a user has entered in the controller which should than be reflected in the corresponding input-field in the view. In the past I ve modifed “$this-\>request-\>data” directly, but this is deprecated now (and I know this is a bad practice). “patchEntity” doesn’t show up in the form frowning Can you give me a hint? Thanks, Frank
