{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4719","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4719/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4719/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4719/events","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/4719","id":113978601,"number":4719,"title":"BUG Fix regression from #4396 in test fixtures","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":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/milestones/25","html_url":"https://github.com/silverstripe/silverstripe-framework/milestones/3.2.1","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/milestones/25/labels","id":1349666,"number":25,"title":"3.2.1","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":1,"closed_issues":5,"state":"open","created_at":"2015-10-11T21:18:54Z","updated_at":"2015-11-02T02:35:36Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2015-10-29T04:39:22Z","updated_at":"2015-11-08T21:37:36Z","closed_at":"2015-10-29T20:12:08Z","pull_request":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/4719","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/4719","diff_url":"https://github.com/silverstripe/silverstripe-framework/pull/4719.diff","patch_url":"https://github.com/silverstripe/silverstripe-framework/pull/4719.patch"},"body":"During test initialisation, if a Folder is created it doesn't \"exist\" until the physical filesystem folder is created.\r\n\r\nThis means that if a File fixture has a folder as a parent, it will fail to attach during creation, and will end up being set to the root directory.\r\n\r\nE.g. this fixture:\r\n\r\n\r\n```yaml\r\nFolder:\r\n  folder1:\r\n    Name: UploadFieldTest\r\nFile:\r\n  file1:\r\n    Title: File1\r\n    Filename: assets/UploadFieldTest/file1.txt\r\n    Parent: =>Folder.folder1\r\n```\r\n\r\nWill end up with a file in assets/file1.txt\r\n\r\nThe only way to ensure a created directory is valid is to create the underlying filesystem directory on the fly, immediately after saving it to the database (but before being assigned children)."},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/154876209","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/4719#issuecomment-154876209","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4719","id":154876209,"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":"2015-11-08T21:37:36Z","updated_at":"2015-11-08T21:37:36Z","body":"Actually, what I've done instead is setup temporary folders which are assigned fixture-specific asset backends. This also helps test that the backend is actually being relied on properly without simply assuming that files are stored in /assets. :)"}}