Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorasejua
    • CommentTimeJan 17th 2008 edited
     

    Hello again folks,

    EDIT: Reading the similar question in http://forum.akelos.org/discussion/215/updateattribute-strange-behaviour/ with no solution in the beggining, maybe I can give a bit more information.

    I'm having a strange behaviour editing (or adding) registers through akelos forms with fields that contains numbers. Will explain it:

    I have a table that, ids, foreign keys and other data apart, has four integer fields like this one

    min_value int(11) unsigned not null default '0'
    

    The form appears and this field has a integer value that other script has filled in previously, let's say 635 and I edit the field placing a cero 0 on it... When I save the field still keeps the 635 value. Changing it to a > 0 value the edit works right, for example placing a 1 on the field.

    I've debugged the process that saves the edited register and I've found that the function is "cleaning" the field value is castAttributeForDatabase (AkActiveRecord.php line 3256), more precisely in the last return line:

    return empty($this->_columns[$column_name]['notNull']) ? ($result === '' ? "''" : $result) : ($result == 'null' ? '' : $result);
    

    When arrives to this point the last $result == 'null' ? comparison returns true (when $result in that moment is (int)0. So, the function returns an empty value. All the other fields are saved okay, but the emptied ones are obviously ignored.

    Why does it happen? I'm absolutely stuck with this :P

    Thanks in advance, as always ^

    • CommentAuthorKaste
    • CommentTimeJan 17th 2008
     

    ty, follow-up is here

    feel free to create a ticket

Add your comments
    Username Password
  • Format comments as