{"action":"closed","issue":{"url":"https://api.github.com/repos/marmelab/ng-admin/issues/1079","repository_url":"https://api.github.com/repos/marmelab/ng-admin","labels_url":"https://api.github.com/repos/marmelab/ng-admin/issues/1079/labels{/name}","comments_url":"https://api.github.com/repos/marmelab/ng-admin/issues/1079/comments","events_url":"https://api.github.com/repos/marmelab/ng-admin/issues/1079/events","html_url":"https://github.com/marmelab/ng-admin/issues/1079","id":156149065,"number":1079,"title":"Reference error when 404","user":{"login":"sam2x","id":11001928,"avatar_url":"https://avatars.githubusercontent.com/u/11001928?v=3","gravatar_id":"","url":"https://api.github.com/users/sam2x","html_url":"https://github.com/sam2x","followers_url":"https://api.github.com/users/sam2x/followers","following_url":"https://api.github.com/users/sam2x/following{/other_user}","gists_url":"https://api.github.com/users/sam2x/gists{/gist_id}","starred_url":"https://api.github.com/users/sam2x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sam2x/subscriptions","organizations_url":"https://api.github.com/users/sam2x/orgs","repos_url":"https://api.github.com/users/sam2x/repos","events_url":"https://api.github.com/users/sam2x/events{/privacy}","received_events_url":"https://api.github.com/users/sam2x/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-05-22T12:07:31Z","updated_at":"2016-10-03T08:19:05Z","closed_at":"2016-10-03T08:19:05Z","body":"Hey, i spotted an issue. I have :\r\n  \r\n- Two entities named **X** and **Y**. \r\n- **X** has a 'reference' field named **foreign_id** pointing to **Y** id.\r\n\r\nWhen i delete Y **from the backend**, and load the view X, ng-admin fetch my Y referenced entity (who is still referenced), and got 404 error (until now, everything is \"normal\"). \r\n\r\nHowever i was expecting ng-admin to handle this case, and set \"empty\" value to my field, or red cross to this field. However, ng-admin throws the following error : \r\n\r\n     TypeError: t.datastore(...).getEntries(...).find is not a function\r\n         at link (http://xxx/js/admin.js:16:25264)\r\n         at http://xxx/js/admin.js:25:5744\r\n         at ae (http://xxx//js/admin.js:25:5801)\r\n         at g (http://xxx//js/admin.js:24:31621)\r\n         at s (http://xxx//js/admin.js:24:27816)\r\n         at g (http://xxx//js/admin.js:24:31570)\r\n         at s (http://xxx/js/admin.js:24:27816)\r\n         at g (http://xxx/js/admin.js:24:31570)\r\n         at s (http://xxx/js/admin.js:24:27816)\r\n         at $get.t (http://xxx/js/admin.js:24:27345) <ma-reference-field field=\"::field\" value=\"value\" datastore=\"::datastore\" class=\"ng-isolate-scope\"> \r\n\r\nIncriminated file  : https://github.com/marmelab/ng-admin/blob/8c6d74bde7ca0281739f171f1353e8d40bfc59e6/src/javascripts/ng-admin/Crud/field/maReferenceField.js\r\n\r\nIn show view it's not a big deal, but in edition view ng-admin breaks his 'list' reference feature, so i can't  select new value from the list. \r\nI tried to handle this with restangular by returning default value, no luck. Anyone has handled this edge case ? "}}
{"actor":{"display_login":"jpetitcolas"}}