{"action":"opened","issue":{"url":"https://api.github.com/repos/christiansalazar/yiiattributex/issues/4","repository_url":"https://api.github.com/repos/christiansalazar/yiiattributex","labels_url":"https://api.github.com/repos/christiansalazar/yiiattributex/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/christiansalazar/yiiattributex/issues/4/comments","events_url":"https://api.github.com/repos/christiansalazar/yiiattributex/issues/4/events","html_url":"https://github.com/christiansalazar/yiiattributex/issues/4","id":162055572,"number":4,"title":"Empty attributes values when calling update()","user":{"login":"christiansalazar","id":1652867,"avatar_url":"https://avatars.githubusercontent.com/u/1652867?v=3","gravatar_id":"","url":"https://api.github.com/users/christiansalazar","html_url":"https://github.com/christiansalazar","followers_url":"https://api.github.com/users/christiansalazar/followers","following_url":"https://api.github.com/users/christiansalazar/following{/other_user}","gists_url":"https://api.github.com/users/christiansalazar/gists{/gist_id}","starred_url":"https://api.github.com/users/christiansalazar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christiansalazar/subscriptions","organizations_url":"https://api.github.com/users/christiansalazar/orgs","repos_url":"https://api.github.com/users/christiansalazar/repos","events_url":"https://api.github.com/users/christiansalazar/events{/privacy}","received_events_url":"https://api.github.com/users/christiansalazar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-24T01:02:20Z","updated_at":"2016-06-24T01:02:20Z","closed_at":null,"body":"Problem:\r\n\r\nWhen loading a object and immediatly call update() it will destroy all values previously defined because it never initialize after constructor is called.\r\n\r\nHow to reproduce:\r\n\r\n// success:\r\n$object = Some::model()->findByPk(123);\r\n$object->first_name = \"Christian\";\r\n$object->update();\r\n$object = Some::model()->findByPk(123);\r\necho $object->first_name; // will echo \"Christian\"\r\n\r\n// now, make bug show up:\r\n$object = Some::model()->findByPk(123);\r\necho $object->first_name; // will echo \"Christian\"\r\n$object = Some::model()->findByPk(123);\r\n$object->update();\r\necho $object->first_name; // will echo \"\" (bug, attributes never loads and save empty values destroying the record values)\r\n"}}
{"actor":{"display_login":"christiansalazar"}}