⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

change_field_type not working...



jcasanova
  • profile picture
  • Member

Posted 09 May 2012 - 15:55 PM

I got this:

$crud->fields('username','email','password','password_confirm','first_name','last_name','company','phone','grupos');
$crud->change_field_type('password','password');
$crud->change_field_type('password_confirm','password');

password_confirm does not exists in the database table, is just for confirm purpose.
but it doesnt change to "password type".

this doesn't work with files that doesnt exists in the table?


What I did to get it worked is a $crud->callback_add_field('password_confirm',array($this,'cb_password_confirm'));

that returns the input file type password.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 09 May 2012 - 18:34 PM

Yes you are right I don't check if there is a change at the type. By default I just add the fields that doesn't exist in database as string. So yes I can tell that this is a bug. I just track it as an issue: https://github.com/scoumbourdis/grocery-crud/issues/30

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 21 May 2012 - 21:35 PM

Fixed - https://github.com/scoumbourdis/grocery-crud/commit/cba8cf49d67a982491fca9c55f9bc133d5f41b42

jcasanova
  • profile picture
  • Member

Posted 22 May 2012 - 20:09 PM

excellent!!