Closed moutlou closed 3 years ago
Hey, the Validation library is a part of CI, not Ion Auth.
But the variable $message is yours Ben. You are creating this var in the $data. İ didnt check but it musnt have 134 spaces , İ think.
Web Developer & Software Engineer
Kimden: Ben Edmunds @.***>Gönderildi: 2 Nisan 2021 Cuma 02:35Kime: benedmunds/CodeIgniter-Ion-AuthBilgi: Moutlou; AuthorKonu: Re: [benedmunds/CodeIgniter-Ion-Auth] Controllers\Auth Line: 583 $this->data['message'] = $this->validation->getErrors() ? ..... (#1508) Hey, the Validation library is a part of CI, not Ion Auth.
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
Sorry, I'm not quite following. Is this as issue with what validation->getErrors() is returning into $data['message']? Which version of Ion Auth and CI are you using?
Ben, when there aren’t errors it not returning an empty string but a string with 134 spaces.
From: Ben Edmunds @.> Sent: Friday, April 2, 2021 6:11 PM To: benedmunds/CodeIgniter-Ion-Auth @.> Cc: Moutlou @.>; Author @.> Subject: Re: [benedmunds/CodeIgniter-Ion-Auth] Controllers\Auth Line: 583 $this->data['message'] = $this->validation->getErrors() ? ..... (#1508)
Sorry, I'm not quite following. Is this as issue with what validation->getErrors() is returning into $data['message']? Which version of Ion Auth and CI are you using?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/1508#issuecomment-812571454 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQG7DPXQBQCJPRUUSGAMJY3TGXNABANCNFSM42HVQESA . https://github.com/notifications/beacon/AQG7DPWVNDDILHKZMBOK5WTTGXNABA5CNFSM42HVQESKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGBXNWPQ.gif
Which version of Ion Auth and CI are you using?
I’m using Codeigniter 4 and IonAuth 4
I’m using it with extending your base class like this
class Authentication extends \IonAuth\Controllers\Auth
without any implementation into mt main class
From: Ben Edmunds @.> Sent: Friday, April 2, 2021 8:47 PM To: benedmunds/CodeIgniter-Ion-Auth @.> Cc: Moutlou @.>; Author @.> Subject: Re: [benedmunds/CodeIgniter-Ion-Auth] Controllers\Auth Line: 583 $this->data['message'] = $this->validation->getErrors() ? ..... (#1508)
Which version of Ion Auth and CI are you using?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/1508#issuecomment-812637425 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQG7DPWAGL5GYOSWLTLLVWDTGX7JXANCNFSM42HVQESA . https://github.com/notifications/beacon/AQG7DPVJHI64NYZGQKKVK6TTGX7JXA5CNFSM42HVQESKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGBX5Z4I.gif
validation->getErrors() should return as array, not a string... See the CI source here: https://github.com/codeigniter4/CodeIgniter4/blob/develop/system/Validation/Validation.php#L741
If you have an error are you getting an array back? Which commit hash or specific version of CI are you using?
Hello Ben,
The variable $message with var_dump($message) showed [string(139) “ “] ….
So, I found the problem. The variable $message contains the debug string as hex an it not showing anything.
The debug string is :
“
” From: Ben Edmunds ***@***.***> Sent: Monday, April 5, 2021 7:21 PM To: benedmunds/CodeIgniter-Ion-Auth ***@***.***> Cc: Moutlou ***@***.***>; Author ***@***.***> Subject: Re: [benedmunds/CodeIgniter-Ion-Auth] Controllers\Auth Line: 583 $this->data['message'] = $this->validation->getErrors() ? ..... (#1508) validation->getErrors() should return as array, not a string... See the CI source here: https://github.com/codeigniter4/CodeIgniter4/blob/develop/system/Validation/Validation.php#L741 If you have an error are you getting an array back? Which commit hash or specific version of CI are you using? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubSo it is an empty array? Is there an issue with that?
No all are ok now Ben
From: Ben Edmunds @.> Sent: Tuesday, April 6, 2021 6:21 PM To: benedmunds/CodeIgniter-Ion-Auth @.> Cc: Moutlou @.>; Author @.> Subject: Re: [benedmunds/CodeIgniter-Ion-Auth] Controllers\Auth Line: 583 $this->data['message'] = $this->validation->getErrors() ? ..... (#1508)
So it is an empty array? Is there an issue with that?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/1508#issuecomment-814207161 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQG7DPQCHHYA2OF7HIVOOJTTHMRE7ANCNFSM42HVQESA . https://github.com/notifications/beacon/AQG7DPUUT323V2RZHL6CYU3THMRE7A5CNFSM42HVQESKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGCD5BOI.gif
Ok cool. Closing this issue then, thanks!
PLease fix it to return empty string. When there aren't erros it returning a string with length = 134. We need preg_match or trim to check if is empty or not. Otherwise you can add a variable like me
$this->data['hasErrors'] = $this->validation->getErrors() ? true : false ;
Thank you for this great library Ben.