{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5545","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-framework","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5545/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5545/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5545/events","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/5545","id":155182388,"number":5545,"title":"BUG Fix DataObject::isChanged() detecting non saveble changes","user":{"login":"tractorcow","id":936064,"avatar_url":"https://avatars.githubusercontent.com/u/936064?v=3","gravatar_id":"","url":"https://api.github.com/users/tractorcow","html_url":"https://github.com/tractorcow","followers_url":"https://api.github.com/users/tractorcow/followers","following_url":"https://api.github.com/users/tractorcow/following{/other_user}","gists_url":"https://api.github.com/users/tractorcow/gists{/gist_id}","starred_url":"https://api.github.com/users/tractorcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tractorcow/subscriptions","organizations_url":"https://api.github.com/users/tractorcow/orgs","repos_url":"https://api.github.com/users/tractorcow/repos","events_url":"https://api.github.com/users/tractorcow/events{/privacy}","received_events_url":"https://api.github.com/users/tractorcow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/milestones/29","html_url":"https://github.com/silverstripe/silverstripe-framework/milestones/3.4.0","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/milestones/29/labels","id":1472109,"number":29,"title":"3.4.0","description":"","creator":{"login":"tractorcow","id":936064,"avatar_url":"https://avatars.githubusercontent.com/u/936064?v=3","gravatar_id":"","url":"https://api.github.com/users/tractorcow","html_url":"https://github.com/tractorcow","followers_url":"https://api.github.com/users/tractorcow/followers","following_url":"https://api.github.com/users/tractorcow/following{/other_user}","gists_url":"https://api.github.com/users/tractorcow/gists{/gist_id}","starred_url":"https://api.github.com/users/tractorcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tractorcow/subscriptions","organizations_url":"https://api.github.com/users/tractorcow/orgs","repos_url":"https://api.github.com/users/tractorcow/repos","events_url":"https://api.github.com/users/tractorcow/events{/privacy}","received_events_url":"https://api.github.com/users/tractorcow/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":10,"state":"open","created_at":"2015-12-23T01:59:08Z","updated_at":"2016-05-17T06:30:33Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-05-17T05:54:42Z","updated_at":"2016-05-17T10:05:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/5545","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/5545","diff_url":"https://github.com/silverstripe/silverstripe-framework/pull/5545.diff","patch_url":"https://github.com/silverstripe/silverstripe-framework/pull/5545.patch"},"body":"When certain properties are saved against a dataobject (e.g. via dependency injection) it often has the effect of incorrectly marking the object as dirty (even if those properties aren't database fields).\r\n\r\nThis change also removes a lot of duplicate code from updateChanges() that really isn't necessary. If $forceChanges is true, change detection isn't necessary, and updating changes can be done by simply piggy backing off isChanged() which invokes getChangedFields().\r\n\r\nIf users want to get all changed fields, even if they aren't database fields (which is the exception rather than the rule) they can still use getChangedFields(true) to get all non-db fields also.\r\n\r\nThis is against 3.x since it is a slight change in behaviour, and has a risk of regression.\r\n\r\nI'm not sure if this should go into 3.4.0 or 3.5.0, due to the risk."},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/219674280","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/5545#issuecomment-219674280","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5545","id":219674280,"user":{"login":"tractorcow","id":936064,"avatar_url":"https://avatars.githubusercontent.com/u/936064?v=3","gravatar_id":"","url":"https://api.github.com/users/tractorcow","html_url":"https://github.com/tractorcow","followers_url":"https://api.github.com/users/tractorcow/followers","following_url":"https://api.github.com/users/tractorcow/following{/other_user}","gists_url":"https://api.github.com/users/tractorcow/gists{/gist_id}","starred_url":"https://api.github.com/users/tractorcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tractorcow/subscriptions","organizations_url":"https://api.github.com/users/tractorcow/orgs","repos_url":"https://api.github.com/users/tractorcow/repos","events_url":"https://api.github.com/users/tractorcow/events{/privacy}","received_events_url":"https://api.github.com/users/tractorcow/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T10:05:22Z","updated_at":"2016-05-17T10:05:22Z","body":"After much hair pulling, I think I got it to work. :)\r\n\r\nPassing in $isNewRecord instead of $forceInsert to `updateChanges` means that new records will properly get all records initialised as changed."}}