Skip to content

Bug: Validation rules max_size #3122

Description

@mrardiyansyah

To be honest when I use this rule it works as usual. But when adding this query builder update rules it always raises the error message that has been created.

`if ($this->request->getMethod() == 'post') {
$rules = [
'name' => 'required|alpha_space',
'image' => [
'label' => 'Image',
'rules' => 'max_size[image,2048]|mime_in[image,image/gif,image/jpeg,image/png]',
'errors' => [
'max_size' => 'Allowed maximum size is 2MB', //Always display this error message
even though the uploaded file is 1KB
'mime_in' => 'The Image type is not allowed. Allowed types : gif, jpeg, png'

                ],
            ]
        ];

        if (!$this->validate($rules)) {
            $data['validation'] = $this->validator;
        } else {
            $newData = ['a'=>1]
            $model->update('1',$newData);

;`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions