{"action":"created","issue":{"url":"https://api.github.com/repos/pods-framework/pods/issues/2486","labels_url":"https://api.github.com/repos/pods-framework/pods/issues/2486/labels{/name}","comments_url":"https://api.github.com/repos/pods-framework/pods/issues/2486/comments","events_url":"https://api.github.com/repos/pods-framework/pods/issues/2486/events","html_url":"https://github.com/pods-framework/pods/issues/2486","id":50883734,"number":2486,"title":"export / export_pod_item_level","user":{"login":"quasel","id":9464217,"avatar_url":"https://avatars.githubusercontent.com/u/9464217?v=3","gravatar_id":"","url":"https://api.github.com/users/quasel","html_url":"https://github.com/quasel","followers_url":"https://api.github.com/users/quasel/followers","following_url":"https://api.github.com/users/quasel/following{/other_user}","gists_url":"https://api.github.com/users/quasel/gists{/gist_id}","starred_url":"https://api.github.com/users/quasel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasel/subscriptions","organizations_url":"https://api.github.com/users/quasel/orgs","repos_url":"https://api.github.com/users/quasel/repos","events_url":"https://api.github.com/users/quasel/events{/privacy}","received_events_url":"https://api.github.com/users/quasel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pods-framework/pods/labels/Bug:%20Minor","name":"Bug: Minor","color":"e10c02"},{"url":"https://api.github.com/repos/pods-framework/pods/labels/Fixed%20/%20Needs%20Testing","name":"Fixed / Needs Testing","color":"d7e102"}],"state":"open","locked":false,"assignee":{"login":"sc0ttkclark","id":709662,"avatar_url":"https://avatars.githubusercontent.com/u/709662?v=3","gravatar_id":"","url":"https://api.github.com/users/sc0ttkclark","html_url":"https://github.com/sc0ttkclark","followers_url":"https://api.github.com/users/sc0ttkclark/followers","following_url":"https://api.github.com/users/sc0ttkclark/following{/other_user}","gists_url":"https://api.github.com/users/sc0ttkclark/gists{/gist_id}","starred_url":"https://api.github.com/users/sc0ttkclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sc0ttkclark/subscriptions","organizations_url":"https://api.github.com/users/sc0ttkclark/orgs","repos_url":"https://api.github.com/users/sc0ttkclark/repos","events_url":"https://api.github.com/users/sc0ttkclark/events{/privacy}","received_events_url":"https://api.github.com/users/sc0ttkclark/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/pods-framework/pods/milestones/55","html_url":"https://github.com/pods-framework/pods/milestones/Pods%202.5.3","labels_url":"https://api.github.com/repos/pods-framework/pods/milestones/55/labels","id":1002900,"number":55,"title":"Pods 2.5.3","description":"","creator":{"login":"Shelob9","id":1994311,"avatar_url":"https://avatars.githubusercontent.com/u/1994311?v=3","gravatar_id":"","url":"https://api.github.com/users/Shelob9","html_url":"https://github.com/Shelob9","followers_url":"https://api.github.com/users/Shelob9/followers","following_url":"https://api.github.com/users/Shelob9/following{/other_user}","gists_url":"https://api.github.com/users/Shelob9/gists{/gist_id}","starred_url":"https://api.github.com/users/Shelob9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shelob9/subscriptions","organizations_url":"https://api.github.com/users/Shelob9/orgs","repos_url":"https://api.github.com/users/Shelob9/repos","events_url":"https://api.github.com/users/Shelob9/events{/privacy}","received_events_url":"https://api.github.com/users/Shelob9/received_events","type":"User","site_admin":false},"open_issues":37,"closed_issues":102,"state":"open","created_at":"2015-03-02T22:03:57Z","updated_at":"2015-05-29T18:54:00Z","due_on":"2015-05-31T05:00:00Z","closed_at":null},"comments":4,"created_at":"2014-12-03T19:51:16Z","updated_at":"2015-05-29T18:57:02Z","closed_at":null,"body":"Did take me a bit to understand this, i hope i can explain it properly\r\ncurrently export / export_pod_item_level with default depth=2  would produce: \r\n(tested with https://github.com/pods-framework/pods/tree/feature/2.x-optimizations)\r\n\r\n```json\r\n{\r\n    \"id_lvl_1\": {\r\n        *missing* \"id\": \"id_lvl_1\",\r\n        \"field\": \"value\",\r\n        \"pick_lvl_2\": {\r\n            \"id_lvl_2\": {\r\n                *missing* \"id\": \"id_lvl_2\",\r\n                \"field\": \"value\",\r\n                \"pick_lvl_3\": {\r\n                    \"id\": \"id_lvl3\",\r\n                    \"field\": \"value\",\r\n                    \"pod_item_id\":\" id_lvl_3\"  id second time ...\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n* propsed fix https://github.com/pods-framework/pods/pull/2485 for the id's (currently only lvl1 is added)\r\n\r\n* It is expected to export 2 lvls - but it exports 3 lvls and the the 3rd lvl is\r\n rendered differently. pick_lvl_3\": shouldnt it not only list the related id/s - nothing more?\r\n the reason is line 4182 // https://github.com/pods-framework/pods/tree/feature/2.x-optimizations\r\n```php\r\n// Return data exactly as Pods does normally\r\n    else\r\n        $data[ $field[ 'name' ] ] = $pod->field( array( 'name' => $field[ 'name' ], 'output' => 'arrays' ) );\r\n```\r\n wich adds if it is a pick field the \"full array\" hence the situation with the akward layout. Not sure if/how this could be fixed without maybe breaking existing solutions :/  \r\n\r\nIf a change is considered i would suggest to go a step further and remove  the  \"id_lvl_x\" key altogether to simplify it - and adopt the same data structure as WP-API.\r\n\r\nThis is related too -  https://github.com/pods-framework/pods-json-api/issues/19\r\nbecause it is used for the API"},"comment":{"url":"https://api.github.com/repos/pods-framework/pods/issues/comments/106903443","html_url":"https://github.com/pods-framework/pods/issues/2486#issuecomment-106903443","issue_url":"https://api.github.com/repos/pods-framework/pods/issues/2486","id":106903443,"user":{"login":"quasel","id":9464217,"avatar_url":"https://avatars.githubusercontent.com/u/9464217?v=3","gravatar_id":"","url":"https://api.github.com/users/quasel","html_url":"https://github.com/quasel","followers_url":"https://api.github.com/users/quasel/followers","following_url":"https://api.github.com/users/quasel/following{/other_user}","gists_url":"https://api.github.com/users/quasel/gists{/gist_id}","starred_url":"https://api.github.com/users/quasel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quasel/subscriptions","organizations_url":"https://api.github.com/users/quasel/orgs","repos_url":"https://api.github.com/users/quasel/repos","events_url":"https://api.github.com/users/quasel/events{/privacy}","received_events_url":"https://api.github.com/users/quasel/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T18:57:02Z","updated_at":"2015-05-29T18:57:02Z","body":"its a core issue \r\n"}}