{"action":"created","issue":{"url":"https://api.github.com/repos/jonom/silverstripe-focuspoint/issues/44","repository_url":"https://api.github.com/repos/jonom/silverstripe-focuspoint","labels_url":"https://api.github.com/repos/jonom/silverstripe-focuspoint/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/jonom/silverstripe-focuspoint/issues/44/comments","events_url":"https://api.github.com/repos/jonom/silverstripe-focuspoint/issues/44/events","html_url":"https://github.com/jonom/silverstripe-focuspoint/issues/44","id":234413713,"number":44,"title":"Image_Cached injector support","user":{"login":"thats4shaw","id":855269,"avatar_url":"https://avatars2.githubusercontent.com/u/855269?v=3","gravatar_id":"","url":"https://api.github.com/users/thats4shaw","html_url":"https://github.com/thats4shaw","followers_url":"https://api.github.com/users/thats4shaw/followers","following_url":"https://api.github.com/users/thats4shaw/following{/other_user}","gists_url":"https://api.github.com/users/thats4shaw/gists{/gist_id}","starred_url":"https://api.github.com/users/thats4shaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thats4shaw/subscriptions","organizations_url":"https://api.github.com/users/thats4shaw/orgs","repos_url":"https://api.github.com/users/thats4shaw/repos","events_url":"https://api.github.com/users/thats4shaw/events{/privacy}","received_events_url":"https://api.github.com/users/thats4shaw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-08T05:15:15Z","updated_at":"2017-06-08T20:06:51Z","closed_at":null,"body":"I've inherited a project that uses this addon and after upgrading to SilverStripe 3.6.0 i've run into a bunch of interesting warnings.\r\n\r\n[User Warning] DataObject::__construct passed The value 'random/image.jpg'. It's supposed to be passed an array, taken straight from the database. Perhaps you should use DataList::create()->First(); instead?\r\n\r\nThe error appears to be trigger by this change https://github.com/silverstripe/silverstripe-framework/pull/6845/commits/1d36f354e8349616c7b39fcade859fbcf0f9c362.\r\n\r\nFrom my understanding this might make the FPImage_cached class in code/FPImage useful now?\r\n\r\nTo test this theory\r\nIf I uncomment the FPImage_cached class and swap out the class in yml as below my warnings disappear.\r\n\r\n```\r\nInjector:\r\n  Image_Cached:\r\n    class: FPImage_cached\r\n```\r\n\r\nDoes all this sound sensible @jonom?\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jonom/silverstripe-focuspoint/issues/comments/307212696","html_url":"https://github.com/jonom/silverstripe-focuspoint/issues/44#issuecomment-307212696","issue_url":"https://api.github.com/repos/jonom/silverstripe-focuspoint/issues/44","id":307212696,"user":{"login":"jonom","id":1079425,"avatar_url":"https://avatars2.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},"created_at":"2017-06-08T20:06:51Z","updated_at":"2017-06-08T20:06:51Z","body":"> From my understanding this might make the FPImage_cached class in code/FPImage useful now?\r\n\r\nYes, it does look like FPImage would be useful now!\r\n\r\nHowever, I'm surprised that your fix would work. I wonder if it could be a coincidence? Sometimes with image stuff in SilverStripe, because the images are cached and there is some protection against re-trying crashing manipulations, you don't get the same result every time. For instance if the warning above is only generated when a manipulated image is being created and written to disk, you wouldn't see it on subsequent requests once it is already available and doesn't need to be generated.\r\n\r\nCan you try flushing the cache while on the page that has the images that were causing an error, so the images are regenerated? If you can do this a few times with and without the fix in place it might tell us if it really works.\r\n\r\nMy gut feeling is that https://github.com/silverstripe/silverstripe-framework/commit/1d36f354e8349616c7b39fcade859fbcf0f9c362 may have introduced a regression. Image_cached is a bit of weird class that thinks it's a dataobject but isn't really, so maybe it trips up a bit when the Injector is used to create it."}}
{"actor":{"display_login":"jonom"}}