{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/nova-issues/issues/744","repository_url":"https://api.github.com/repos/laravel/nova-issues","labels_url":"https://api.github.com/repos/laravel/nova-issues/issues/744/labels{/name}","comments_url":"https://api.github.com/repos/laravel/nova-issues/issues/744/comments","events_url":"https://api.github.com/repos/laravel/nova-issues/issues/744/events","html_url":"https://github.com/laravel/nova-issues/issues/744","id":365163490,"node_id":"MDU6SXNzdWUzNjUxNjM0OTA=","number":744,"title":"[Bug] MorphTo not working on form edit when there is a morphmap assigned","user":{"login":"paras-malhotra","id":16099046,"node_id":"MDQ6VXNlcjE2MDk5MDQ2","avatar_url":"https://avatars2.githubusercontent.com/u/16099046?v=4","gravatar_id":"","url":"https://api.github.com/users/paras-malhotra","html_url":"https://github.com/paras-malhotra","followers_url":"https://api.github.com/users/paras-malhotra/followers","following_url":"https://api.github.com/users/paras-malhotra/following{/other_user}","gists_url":"https://api.github.com/users/paras-malhotra/gists{/gist_id}","starred_url":"https://api.github.com/users/paras-malhotra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paras-malhotra/subscriptions","organizations_url":"https://api.github.com/users/paras-malhotra/orgs","repos_url":"https://api.github.com/users/paras-malhotra/repos","events_url":"https://api.github.com/users/paras-malhotra/events{/privacy}","received_events_url":"https://api.github.com/users/paras-malhotra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-29T20:14:10Z","updated_at":"2018-11-28T12:08:19Z","closed_at":null,"author_association":"NONE","body":"This is a reopen of #430 opened 25 days ago as it has not yet been fixed but closed. This issue persists in Nova 1.1.3 so please do not close this assuming this has been fixed. It has not!!\r\n\r\nI have a MorphMap assigned in my AppServiceProvider like so:\r\n\r\n```\r\nRelation::morphMap([\r\n    'campaign' => Campaign::class,\r\n    'campaign_offer' => CampaignOffer::class,\r\n]);\r\n```\r\n\r\nIn my resource class, I defined the MorphTo field (with columns named related_id, related_type) like so:\r\n\r\n```\r\nMorphTo::make('Related')->types([\r\n    Campaign::class,\r\n    CampaignOffer::class,\r\n])->searchable(),\r\n```\r\n\r\nOn the index and the detail page, all is good! We can see the related campaign and campaign offers. But on the form page, when I click edit on a record, the values are not pre-populated properly. Here are the screenshots:\r\n\r\nIndex Page looking good:\r\n\r\n<img width=\"1132\" alt=\"screen shot 2018-09-04 at 10 01 08 pm\" src=\"https://user-images.githubusercontent.com/16099046/45044722-8f404a80-b08e-11e8-8745-69bedd288a84.png\">\r\n\r\nForm Detail looking good:\r\n\r\n<img width=\"1146\" alt=\"screen shot 2018-09-04 at 10 03 56 pm\" src=\"https://user-images.githubusercontent.com/16099046/45044759-a54e0b00-b08e-11e8-923d-f1fc51eff37b.png\">\r\n\r\nForm edit broken (this is for ID 421 as shown in the screenshots above) ! The expected behaviour is that it should have the associated Campaign Offer populated on the edit page\r\n\r\n<img width=\"1136\" alt=\"screen shot 2018-09-04 at 10 04 06 pm\" src=\"https://user-images.githubusercontent.com/16099046/45044775-b1d26380-b08e-11e8-966a-734b7e62a92a.png\">\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/nova-issues/issues/comments/442424725","html_url":"https://github.com/laravel/nova-issues/issues/744#issuecomment-442424725","issue_url":"https://api.github.com/repos/laravel/nova-issues/issues/744","id":442424725,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjQyNDcyNQ==","user":{"login":"paras-malhotra","id":16099046,"node_id":"MDQ6VXNlcjE2MDk5MDQ2","avatar_url":"https://avatars2.githubusercontent.com/u/16099046?v=4","gravatar_id":"","url":"https://api.github.com/users/paras-malhotra","html_url":"https://github.com/paras-malhotra","followers_url":"https://api.github.com/users/paras-malhotra/followers","following_url":"https://api.github.com/users/paras-malhotra/following{/other_user}","gists_url":"https://api.github.com/users/paras-malhotra/gists{/gist_id}","starred_url":"https://api.github.com/users/paras-malhotra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paras-malhotra/subscriptions","organizations_url":"https://api.github.com/users/paras-malhotra/orgs","repos_url":"https://api.github.com/users/paras-malhotra/repos","events_url":"https://api.github.com/users/paras-malhotra/events{/privacy}","received_events_url":"https://api.github.com/users/paras-malhotra/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T12:08:19Z","updated_at":"2018-11-28T12:08:19Z","author_association":"NONE","body":"@davidhemphill @taylorotwell would really appreciate if you could help us with this issue 🙏. Some folks have posted code change suggestions as well."}}
{"actor":{"display_login":"paras-malhotra"}}