# Deprecated (16384): Using key \`action\` is deprecated, use \`url\` directly instead. \[CORE/Cake/View/Helper/FormHelper.php, line 383

**URL:** <https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690>\
**Category:** Need Help\
**Created:** [February 22, 2019, 4:58am UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690 "2019-02-22T04:58:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeros](https://avatars.discourse-cdn.com/v4/letter/y/90db22/32.png) [@yeros](https://discourse.cakephp.org/u/yeros)\
**Post date:** [February 22, 2019, 4:58am UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/1 "2019-02-22T04:58:40Z")

</div>

Hello,

The reason why I’m here is one of my clients asked me to fix his CakePhp script. Unfortunately I don’t have any experience of work with this framework, it’s my first time.

Client have a site - where cakephp is istalled in admin/ folder. When I’m trying to open this url … [domain.com/admin/users/login](http://domain.com/admin/users/login) - i see login form and error mentioned above. Unfortunately all user accounts provided by client - doesn’t work. When I try to Reset Password - I got another error`Deprecated (16384): Validation::notEmpty() is deprecated. Use Validation::notBlank() instead. [CORE/Cake/Utility/Validation.php, line 60] Warning (2): rand() expects parameter 2 to be integer, float given [APP/Model/User.php, line 156]`

according to config file 0.2.9 version is installed on PHP Version 7.2.7-1+0 server.

Any advice will be appreciated  
Thank you

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [February 22, 2019, 5:58am UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/2 "2019-02-22T05:58:30Z")

</div>

I don’t believe there ever was a CakePHP version 0.2.9, and if there was it would never run on PHP 7. That’s maybe the version of some plugin?

---

<div class="post-metadata">

**Author:** ![sipiatti](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/sipiatti/32/1235_2.png) [@sipiatti](https://discourse.cakephp.org/u/sipiatti)\
**Post date:** [February 22, 2019, 6:59am UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/3 "2019-02-22T06:59:40Z")

</div>

It could be cakephp 2.9.0…  
If it is so:  
In the user model file app/Model/User.php check for validation rules and change notEmpty rule to notBlank.

For ‘action’ deprecated problem find find app/view/Users/login.ctp and find $this-\>Form-\>create(…)  
and change ‘action’ to array(‘url’=\>array(‘controller’=\>‘users’,‘action’=\>‘whatever action name was in it before’))

If cakephp base version is 3, then the files you need to change are in app/src, but there is a completly different story.  
check [http://book.cakephp.org](http://book.cakephp.org) for more info (don’t forget to change the book version to your cakephp version, I guess to 2.x). You could find infos about deprecated things also.

---

<div class="post-metadata">

**Author:** ![yeros](https://avatars.discourse-cdn.com/v4/letter/y/90db22/32.png) [@yeros](https://discourse.cakephp.org/u/yeros)\
**Post date:** [February 22, 2019, 4:16pm UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/4 "2019-02-22T16:16:44Z")

</div>

@Zuluru

Here what I find in config file

- copyright Copyright © Cake Software Foundation, Inc. ()
- link [cakephp.org](http://cakephp.org) CakePHP™ Project
- package app.Config
- since CakePHP™ v 0.2.9

---

<div class="post-metadata">

**Author:** ![yeros](https://avatars.discourse-cdn.com/v4/letter/y/90db22/32.png) [@yeros](https://discourse.cakephp.org/u/yeros)\
**Post date:** [February 22, 2019, 4:33pm UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/5 "2019-02-22T16:33:09Z")

</div>

Ok. Sipiatti, I’ll try it now.

2 more questions:

1. Unfortunately I can’t login, using the Login pass that I have - I got another error -

> [**Deprecated** (16384)](javascript:void(0);): Validation::notEmpty() is deprecated. Use Validation::notBlank() instead. [**CORE/Cake/Utility/Validation.php** , line **60**]

> **[Screenshot](https://prnt.sc/moqavb)**
>
> Captured with Lightshot

1. How can I change password from database?  
used MD5 and other various algorithms with no luck

---

<div class="post-metadata">

**Author:** ![yeros](https://avatars.discourse-cdn.com/v4/letter/y/90db22/32.png) [@yeros](https://discourse.cakephp.org/u/yeros)\
**Post date:** [February 22, 2019, 6:50pm UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/6 "2019-02-22T18:50:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sipiatti](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/sipiatti/32/1235_2.png) [@sipiatti](https://discourse.cakephp.org/u/sipiatti)\
**Post date:** [February 22, 2019, 9:32pm UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/7 "2019-02-22T21:32:25Z")

</div>

Your Cakephp version is 2.10.15  
I guess your app is using the cakephp auth component, so it uses sha algorithm with a ‘salt’ so insert password through e.g. phpmyadmin is not possible.

Make an action in users controller like this:

```auto
public function resetadminpw() {
    $user = $this->User->find('first', array('conditions' => array('User.' . $this->User->primaryKey => 1)));
    $user['User']['password'] = 'abc123';
    $this->User->save($user);
    $this->redirect(array('action'=>'login'));
}

```

In order to use it you need to allow the resetadminpw action in your app without login. If the Auth component has been set to use controller authentication then you could allow it in the controller’s beforeFilter method:

```auto
public function beforeFilter() {
        parent::beforeFilter();
        $this->Auth->allow('login','logout','resetadminpw');
    }

```

Then you only have to call [http://yourappurl/users/resetadminpw](http://yourappurl/users/resetadminpw) and login after it with the username of the ID1 user (from users table) and abc123 as password

---

<div class="post-metadata">

**Author:** ![yeros](https://avatars.discourse-cdn.com/v4/letter/y/90db22/32.png) [@yeros](https://discourse.cakephp.org/u/yeros)\
**Post date:** [February 25, 2019, 3:36am UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/8 "2019-02-25T03:36:46Z")

</div>

Thank Sipiatti, deprecated error is gone on load, but it returns when trying to log in. definitely has something to do with validating the login/password now.

---

<div class="post-metadata">

**Author:** ![yeros](https://avatars.discourse-cdn.com/v4/letter/y/90db22/32.png) [@yeros](https://discourse.cakephp.org/u/yeros)\
**Post date:** [February 25, 2019, 3:44am UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/9 "2019-02-25T03:44:38Z")

</div>

[sipiatti](https://discourse.cakephp.org/u/sipiatti)

Can you clarify where I need to put this code? In which file ?

---

<div class="post-metadata">

**Author:** ![sipiatti](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/sipiatti/32/1235_2.png) [@sipiatti](https://discourse.cakephp.org/u/sipiatti)\
**Post date:** [February 25, 2019, 9:13am UTC](https://discourse.cakephp.org/t/deprecated-16384-using-key-action-is-deprecated-use-url-directly-instead-core-cake-view-helper-formhelper-php-line-383/5690/10 "2019-02-25T09:13:43Z")

</div>

You need to put it in the UsersController.php
