Cakephp: 3.4 validExtension is not work correctly

Created on 6 Mar 2017  路  3Comments  路  Source: cakephp/cakephp

This is a (multiple allowed):

  • [x] bug
  • [ ] enhancement
  • [ ] feature-discussion (RFC)

  • CakePHP Version: 3,4,3

    What happened

        $validator
            ->add('image', 'file', [
                'rule' => ['mimeType', ['image/jpeg', 'image/png']]
            ])
            // ->add('image', [
            //    'validExtension' => [
            //        'rule' => ['extension',['png','jpeg','jpg']], // default  ['gif', 'jpeg', 'png', 'jpg']
            //        'message' => __('validExtension error')
            //    ]
            //])
;

validExtension is not work in cake 3.4.3 and returned error with validExtension error message
but works correctly in cake 3.3.x
i used some config (model/entity/controller/ sql schema )
i see https://book.cakephp.org/3.0/en/appendices/3-4-migration-guide.html but there is not any docs for this

defect

Most helpful comment

CakePHP Version: 3,4,3

3.4.3 hasn't even been released, latest is 3.4.2 :)

All 3 comments

controller code

        $entity = $this->Images->newEntity();
        $entity = $this->Images->patchEntity($entity, $this->request->data);

Duplicate of #10267, fixed in #10297

CakePHP Version: 3,4,3

3.4.3 hasn't even been released, latest is 3.4.2 :)

Was this page helpful?
0 / 5 - 0 ratings