{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4700","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4700/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4700/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4700/events","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/4700","id":112931022,"number":4700,"title":"3.2: Missing records in sub-class table","user":{"login":"jonom","id":1079425,"avatar_url":"https://avatars.githubusercontent.com/u/1079425?v=3","gravatar_id":"","url":"https://api.github.com/users/jonom","html_url":"https://github.com/jonom","followers_url":"https://api.github.com/users/jonom/followers","following_url":"https://api.github.com/users/jonom/following{/other_user}","gists_url":"https://api.github.com/users/jonom/gists{/gist_id}","starred_url":"https://api.github.com/users/jonom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonom/subscriptions","organizations_url":"https://api.github.com/users/jonom/orgs","repos_url":"https://api.github.com/users/jonom/repos","events_url":"https://api.github.com/users/jonom/events{/privacy}","received_events_url":"https://api.github.com/users/jonom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-23T02:40:32Z","updated_at":"2015-10-23T08:19:38Z","closed_at":null,"body":"I'm just upgrading my boilerplate project and noticed I was having trouble with Images. A bunch of them seemed to be behaving only as Files all of a sudden. I checked the database and while there were lots of records in the File table with a ClassName of Image, there were only a handful of records in the Image table.\r\n\r\nThere should be a record in the Image table for each ClassName=Image record in the File table right?\r\n\r\nTo test I deleted the Image table by removing the extension that's adding properties to Image, and rebuilt the database. Then I created a simple extension to add a $db property to Image, and rebuilt again. An Image table is built but it is empty. Image::get() comes up empty.\r\n\r\nAnyone know what's going on here? I'm going to be away for a few days but here are some test files if anyone wants to investigate: http://cl.ly/402J242f3D10/ImageTableTest.zip"},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/150507051","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/4700#issuecomment-150507051","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4700","id":150507051,"user":{"login":"sminnee","id":59968,"avatar_url":"https://avatars.githubusercontent.com/u/59968?v=3","gravatar_id":"","url":"https://api.github.com/users/sminnee","html_url":"https://github.com/sminnee","followers_url":"https://api.github.com/users/sminnee/followers","following_url":"https://api.github.com/users/sminnee/following{/other_user}","gists_url":"https://api.github.com/users/sminnee/gists{/gist_id}","starred_url":"https://api.github.com/users/sminnee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sminnee/subscriptions","organizations_url":"https://api.github.com/users/sminnee/orgs","repos_url":"https://api.github.com/users/sminnee/repos","events_url":"https://api.github.com/users/sminnee/events{/privacy}","received_events_url":"https://api.github.com/users/sminnee/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T08:19:38Z","updated_at":"2015-10-23T08:19:38Z","body":"The queries are usually constructed such that the Image entry is optional, and if missing, all its records are returned a `null`. The query should be along the lines of `SELECT * FROM File LEFT JOIN Image WHRE File.ClassName = 'Image'`;"}}