Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Kohana][Kohana3.3] Auth module, ORM_Validation_Exception [ 0 ]: Failed to validate array
pkielski
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 21.07.2016

Ostrzeżenie: (0%)
-----


Problem w rodzaju - banalna sprawa, wszystko powinno działać, no i nie działa (IMG:style_emoticons/default/smile.gif)

Tworze sobie od nowa portal uzyczam.pl, zaczalem od rejestracji uzytkownikow i tutaj schody, rejestracja pod adresem:
http://uzyczam.pl/rejestracja

Tabele z uzytkownikami standardowe z modulu Auth, jedyna zmiana to w Users pole username to bedzie tak naprawde email
  1. CREATE TABLE IF NOT EXISTS `upl_users` (
  2. `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  3. `username` varchar(254) NOT NULL,
  4. `password` varchar(64) NOT NULL,
  5. `logins` int(10) UNSIGNED NOT NULL DEFAULT '0',
  6. `last_login` int(10) UNSIGNED,
  7. PRIMARY KEY (`id`),
  8. UNIQUE KEY `uniq_email` (`email`)
  9. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;


Metoda:
  1. public function action_register()
  2. {
  3. $this->template->title = __('Uzyczam.pl - rejestracja');
  4.  
  5. $error = '';
  6. $success = '';
  7. if(isset($_POST['email']))
  8. {
  9. if(ORM::factory('User')->where('username', '=', $_POST['email'])->count_all()>0)
  10. $error .= __('Użytkownik korzystający z tego emaila istnieje już w bazie. ');
  11.  
  12. if(ORM::factory('City')->where('nazwa', '=', $_POST['city'])->count_all()==0)
  13. $error .= __('Nie znaleziono podanej nazwy miejscowości w bazie. ');
  14.  
  15. if($error == '')
  16. {
  17.  
  18.  
  19. $user = ORM::factory('User');
  20. $user->username = $this->request->post('email');
  21.  
  22. $user->password = $this->request->post('password');
  23.  
  24. $user->save();
  25. #$user->role = $user->id;
  26.  
  27. $success .= __('Zostałeś zarejestrowany, możesz się zalogować.');
  28. }
  29. }
  30.  
  31.  
  32. $this->template->content = View::factory('template/rejestracja');
  33. $this->template->content->error = $error;
  34. $this->template->content->success = $success;
  35. }


ale nawet gdy na sztywno podalem dane to wyskakuje ten sam blad:
  1. $user = ORM::factory('User');
  2. $user->username = 'adfadadfadsf';
  3.  
  4. $user->password = 'qwerqwerqwer';
  5.  
  6. $user->save();
  7. #$user->role = $user->id;



Cytat
ORM_Validation_Exception [ 0 ]: Failed to validate array
MODPATH/orm/classes/Kohana/ORM.php [ 1275 ]
1270
1271 $array = $this->_validation;
1272
1273 if (($this->_valid = $array->check()) === FALSE OR $extra_errors)
1274 {
1275 $exception = new ORM_Validation_Exception($this->errors_filename(), $array);
1276
1277 if ($extra_errors)
1278 {
1279 // Merge any possible errors from the external object
1280 $exception->add_object('_external', $extra_validation);



Mozecie tam pod tym adresem sprobowac sie zarejestrowac i dokladny komunikat sprawdzic. Rece mi juz opadaja, siedze na tym juz 1,5 dnia, nie wiem gdzie lezy blad, probowalem roznie do tego podejsc, ale ciagle to samo (IMG:style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 27.09.2025 - 05:45