{"action":"created","issue":{"url":"https://api.github.com/repos/agentejo/cockpit/issues/656","repository_url":"https://api.github.com/repos/agentejo/cockpit","labels_url":"https://api.github.com/repos/agentejo/cockpit/issues/656/labels{/name}","comments_url":"https://api.github.com/repos/agentejo/cockpit/issues/656/comments","events_url":"https://api.github.com/repos/agentejo/cockpit/issues/656/events","html_url":"https://github.com/agentejo/cockpit/issues/656","id":293691932,"number":656,"title":"When using Link Collection the link value is not returned when populate=1","user":{"login":"pauloamgomes","id":102261,"avatar_url":"https://avatars0.githubusercontent.com/u/102261?v=4","gravatar_id":"","url":"https://api.github.com/users/pauloamgomes","html_url":"https://github.com/pauloamgomes","followers_url":"https://api.github.com/users/pauloamgomes/followers","following_url":"https://api.github.com/users/pauloamgomes/following{/other_user}","gists_url":"https://api.github.com/users/pauloamgomes/gists{/gist_id}","starred_url":"https://api.github.com/users/pauloamgomes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauloamgomes/subscriptions","organizations_url":"https://api.github.com/users/pauloamgomes/orgs","repos_url":"https://api.github.com/users/pauloamgomes/repos","events_url":"https://api.github.com/users/pauloamgomes/events{/privacy}","received_events_url":"https://api.github.com/users/pauloamgomes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-01T21:36:08Z","updated_at":"2018-02-01T21:48:13Z","closed_at":null,"author_association":"NONE","body":"When implementing the multiple collection link addon, discovered that the link value of the collection link is not returned if we have populate = 1, that seems to happen during:\r\n\r\n`$items[$k] = cockpit('collections')->_resolveLinedkItem($v['link'], $v['_id'], $fieldsFilter);`\r\n\r\nso resuming, if populate is not set we receive the linked collection as below:\r\n\r\n```\r\n[\r\n    {\r\n        \"name\": \"test\",\r\n        \"component\": {\r\n            \"_id\": \"5a71181540289doc371271402\",\r\n            \"link\": \"simpleblock\",\r\n            \"display\": \"Block 1 - Contacts\"\r\n        },\r\n        \"_mby\": \"5a61396e7640edoc1261186187\",\r\n        \"_by\": \"5a61396e7640edoc1261186187\",\r\n        \"_modified\": 1517518388,\r\n        \"_created\": 1517518388,\r\n        \"_id\": \"5a737e34a6ed7doc739007011\"\r\n    }\r\n]\r\n```\r\n\r\nif populate is set we receive the linked contents but not the linked collection name:\r\n\r\n```\r\n[\r\n    {\r\n        \"name\": \"test\",\r\n        \"component\": {\r\n            \"name\": \"something\",\r\n            \"content\": \"contents\",\r\n            \"_mby\": \"5a61396e7640edoc1261186187\",\r\n            \"_by\": \"5a61396e7640edoc1261186187\",\r\n            \"_modified\": 1517361210,\r\n            \"_created\": 1517361173,\r\n            \"_id\": \"5a71181540289doc371271402\"\r\n        },\r\n        \"_mby\": \"5a61396e7640edoc1261186187\",\r\n        \"_by\": \"5a61396e7640edoc1261186187\",\r\n        \"_modified\": 1517518388,\r\n        \"_created\": 1517518388,\r\n        \"_id\": \"5a737e34a6ed7doc739007011\"\r\n    }\r\n]\r\n```\r\n\r\nBelieve that is important to have the linked collection name on the response as we may need to have some logic based on it on the client side application."},"comment":{"url":"https://api.github.com/repos/agentejo/cockpit/issues/comments/362413106","html_url":"https://github.com/agentejo/cockpit/issues/656#issuecomment-362413106","issue_url":"https://api.github.com/repos/agentejo/cockpit/issues/656","id":362413106,"user":{"login":"pauloamgomes","id":102261,"avatar_url":"https://avatars0.githubusercontent.com/u/102261?v=4","gravatar_id":"","url":"https://api.github.com/users/pauloamgomes","html_url":"https://github.com/pauloamgomes","followers_url":"https://api.github.com/users/pauloamgomes/followers","following_url":"https://api.github.com/users/pauloamgomes/following{/other_user}","gists_url":"https://api.github.com/users/pauloamgomes/gists{/gist_id}","starred_url":"https://api.github.com/users/pauloamgomes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauloamgomes/subscriptions","organizations_url":"https://api.github.com/users/pauloamgomes/orgs","repos_url":"https://api.github.com/users/pauloamgomes/repos","events_url":"https://api.github.com/users/pauloamgomes/events{/privacy}","received_events_url":"https://api.github.com/users/pauloamgomes/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T21:48:13Z","updated_at":"2018-02-01T21:48:13Z","author_association":"NONE","body":"Created a possible fix on the PR #657 , kindly confirm that make sense"}}
{"actor":{"display_login":"pauloamgomes"}}