SOLVED: Error editing a record with CakePHP

0

When I edit an entry, it generates the following error:

  

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

When editing and giving it save post or update I get this:

  

Deprecated (16384): Validation :: notEmpty () is deprecated. Use Validation :: notBlank () instead. [CORE \ Cake \ Utility \ Validation.php, line 60]

     

Deprecated (16384): Validation :: notEmpty () is deprecated. Use Validation :: notBlank () instead. [CORE \ Cake \ Utility \ Validation.php, line 60]

I have already made the corrections that were indicated to me, but when executing the CRUD, in the edit, it does not save the editing of the post, it generates the following error:

  

Error: The requested address '/ cakephp2 / posts / edit' was not found on this server.

SOLUTION:

  

change 'action' to 'id' and not 'url'

    
asked by p3n4g05 03.03.2018 в 02:39
source

1 answer

1

Those functions were marked to be removed in version 2 of cake

The first error indicates that instead of using 'action' in the configuration of the form, change it by 'url'

echo $this->Form->create(false, array(
    'url' => array('controller' => 'recipes', 'action' => 'add'),
    'id' => 'RecipesAdd'
));

link

The second error indicates that your validation calls notEmpty change them by notBlank

public $validate = array(
    'title' => array(
        'rule' => 'notBlank',
        'message' => 'This field cannot be left blank'
    )
);

link

    
answered by 03.03.2018 / 02:50
source