{"action":"created","issue":{"url":"https://api.github.com/repos/partkeepr/PartKeepr/issues/579","repository_url":"https://api.github.com/repos/partkeepr/PartKeepr","labels_url":"https://api.github.com/repos/partkeepr/PartKeepr/issues/579/labels{/name}","comments_url":"https://api.github.com/repos/partkeepr/PartKeepr/issues/579/comments","events_url":"https://api.github.com/repos/partkeepr/PartKeepr/issues/579/events","html_url":"https://github.com/partkeepr/PartKeepr/issues/579","id":128598008,"number":579,"title":"Call to member function getType() on null","user":{"login":"dylanjacob","id":1731901,"avatar_url":"https://avatars.githubusercontent.com/u/1731901?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanjacob","html_url":"https://github.com/dylanjacob","followers_url":"https://api.github.com/users/dylanjacob/followers","following_url":"https://api.github.com/users/dylanjacob/following{/other_user}","gists_url":"https://api.github.com/users/dylanjacob/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanjacob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanjacob/subscriptions","organizations_url":"https://api.github.com/users/dylanjacob/orgs","repos_url":"https://api.github.com/users/dylanjacob/repos","events_url":"https://api.github.com/users/dylanjacob/events{/privacy}","received_events_url":"https://api.github.com/users/dylanjacob/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/partkeepr/PartKeepr/labels/Bug","name":"Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/partkeepr/PartKeepr/milestones/17","html_url":"https://github.com/partkeepr/PartKeepr/milestones/0.80","labels_url":"https://api.github.com/repos/partkeepr/PartKeepr/milestones/17/labels","id":1548758,"number":17,"title":"0.80","description":"","creator":{"login":"felicitus","id":162974,"avatar_url":"https://avatars.githubusercontent.com/u/162974?v=3","gravatar_id":"","url":"https://api.github.com/users/felicitus","html_url":"https://github.com/felicitus","followers_url":"https://api.github.com/users/felicitus/followers","following_url":"https://api.github.com/users/felicitus/following{/other_user}","gists_url":"https://api.github.com/users/felicitus/gists{/gist_id}","starred_url":"https://api.github.com/users/felicitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felicitus/subscriptions","organizations_url":"https://api.github.com/users/felicitus/orgs","repos_url":"https://api.github.com/users/felicitus/repos","events_url":"https://api.github.com/users/felicitus/events{/privacy}","received_events_url":"https://api.github.com/users/felicitus/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":7,"state":"open","created_at":"2016-01-28T10:53:17Z","updated_at":"2016-02-12T20:22:11Z","due_on":"2016-02-18T23:00:00Z","closed_at":null},"comments":19,"created_at":"2016-01-25T17:49:34Z","updated_at":"2016-02-18T16:32:03Z","closed_at":null,"body":"I have had this error pop up multiple times doing multiple activities, but in particular I see this issue when trying to add parts to a project. I added some (say 7 for the sake of example) parts and saved the project, but when I try to add additional parts and save the changes to the project I receive an error \"Call to member function getType() on null\".\r\n\r\nLooking at the details, it looks like a request to `PUT /api/projects/1?_dc=1453743452067` results in a 500 response.\r\n\r\nRelated apache2 logs:\r\n```\r\n[Mon Jan 25 09:44:47.181971 2016] [:error] [pid 33018] [client <ip redacted>:59881] PHP Notice:  Undefined offset: 0 in /var/www/PartKeepr/vendor/dunglas/api-bundle/JsonLd/Serializer/ItemNormalizer.php on line 241, referer: https://<hostname redacted>/\r\n[Mon Jan 25 09:44:47.182221 2016] [:error] [pid 33018] [client <ip redacted>:59881] PHP Fatal error:  Call to a member function getType() on null in /var/www/PartKeepr/vendor/dunglas/api-bundle/JsonLd/Serializer/ItemNormalizer.php on line 241, referer: https://<hostname redacted>/\r\n```\r\nIt looks like the issue is related to a dependency (github: dunglas/DunglasApiBundle).  From what I can tell there are no open bugs with that project that sound similar, so this may be better suited for that project, but I wanted to post here as well to see if anyone had any ideas."},"comment":{"url":"https://api.github.com/repos/partkeepr/PartKeepr/issues/comments/185803483","html_url":"https://github.com/partkeepr/PartKeepr/issues/579#issuecomment-185803483","issue_url":"https://api.github.com/repos/partkeepr/PartKeepr/issues/579","id":185803483,"user":{"login":"vmw","id":11546216,"avatar_url":"https://avatars.githubusercontent.com/u/11546216?v=3","gravatar_id":"","url":"https://api.github.com/users/vmw","html_url":"https://github.com/vmw","followers_url":"https://api.github.com/users/vmw/followers","following_url":"https://api.github.com/users/vmw/following{/other_user}","gists_url":"https://api.github.com/users/vmw/gists{/gist_id}","starred_url":"https://api.github.com/users/vmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmw/subscriptions","organizations_url":"https://api.github.com/users/vmw/orgs","repos_url":"https://api.github.com/users/vmw/repos","events_url":"https://api.github.com/users/vmw/events{/privacy}","received_events_url":"https://api.github.com/users/vmw/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T16:32:03Z","updated_at":"2016-02-18T16:32:03Z","body":"To follow up:\r\n\r\nIn addition to dylanjacob patch, we are encountering similar issues: \r\n\r\n2016/02/18 08:26:47 [error] 32469#0: *38536 FastCGI sent in stderr: \"PHP message: PHP Fatal error:  Call to a member function getName() on null in /REDACTED/src/PartKeepr/PartBundle/Entity/Part.php on line 816\" while reading response header from upstream, client: REDACTED, server: REDACTED, request: \"GET /api/parts?_dc=1455812807078&page=1&start=0&itemsPerPage=50&group=%7B%22property%22%3A%22categoryPath%22%2C%22direction%22%3A%22ASC%22%7D&order=%5B%7B%22property%22%3A%22category.categoryPath%22%2C%22direction%22%3A%22ASC%22%7D%2C%7B%22property%22%3A%22name%22%2C%22direction%22%3A%22ASC%22%7D%5D HTTP/1.1\", upstream: \"fastcgi://unix:/run/php-fpm/php-fpm.sock:\", host: \"REDACTED\", referrer: \"REDACTED\"\r\n\r\n\r\nThis issue was addressed in a manner similar to the previous one:\r\n\r\nI modified line 816 in /src/PartKeepr/PartBundle/Entity/Part.php;\r\n\r\n816c816,818\r\n<             $projectNames[] = $projectPart->getProject()->getName();\r\n---\r\n> \t\tif ( $projectPart->getProject() !== null) {\r\n>         \t    $projectNames[] = $projectPart->getProject()->getName();\r\n> \t\t}\r\n\r\n\r\nThis seems to overcome subsequent errors in that form."}}