{"action":"closed","issue":{"url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/5800","labels_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/5800/labels{/name}","comments_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/5800/comments","events_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/5800/events","html_url":"https://github.com/OrchardCMS/Orchard/issues/5800","id":106249069,"number":5800,"title":"ProjectionElement stores query layout by record ID which does not roundtrip through export/import","user":{"login":"DanielStolt","id":3889090,"avatar_url":"https://avatars.githubusercontent.com/u/3889090?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielStolt","html_url":"https://github.com/DanielStolt","followers_url":"https://api.github.com/users/DanielStolt/followers","following_url":"https://api.github.com/users/DanielStolt/following{/other_user}","gists_url":"https://api.github.com/users/DanielStolt/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielStolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielStolt/subscriptions","organizations_url":"https://api.github.com/users/DanielStolt/orgs","repos_url":"https://api.github.com/users/DanielStolt/repos","events_url":"https://api.github.com/users/DanielStolt/events{/privacy}","received_events_url":"https://api.github.com/users/DanielStolt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"sfmskywalker","id":938393,"avatar_url":"https://avatars.githubusercontent.com/u/938393?v=3","gravatar_id":"","url":"https://api.github.com/users/sfmskywalker","html_url":"https://github.com/sfmskywalker","followers_url":"https://api.github.com/users/sfmskywalker/followers","following_url":"https://api.github.com/users/sfmskywalker/following{/other_user}","gists_url":"https://api.github.com/users/sfmskywalker/gists{/gist_id}","starred_url":"https://api.github.com/users/sfmskywalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfmskywalker/subscriptions","organizations_url":"https://api.github.com/users/sfmskywalker/orgs","repos_url":"https://api.github.com/users/sfmskywalker/repos","events_url":"https://api.github.com/users/sfmskywalker/events{/privacy}","received_events_url":"https://api.github.com/users/sfmskywalker/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/OrchardCMS/Orchard/milestones/22","html_url":"https://github.com/OrchardCMS/Orchard/milestones/Orchard%201.9.x","labels_url":"https://api.github.com/repos/OrchardCMS/Orchard/milestones/22/labels","id":1065780,"number":22,"title":"Orchard 1.9.x","description":"Issues assigned to this milestone have been approved to be developed in the next minor version release of Orchard.","creator":{"login":"orchardbot","id":11788683,"avatar_url":"https://avatars.githubusercontent.com/u/11788683?v=3","gravatar_id":"","url":"https://api.github.com/users/orchardbot","html_url":"https://github.com/orchardbot","followers_url":"https://api.github.com/users/orchardbot/followers","following_url":"https://api.github.com/users/orchardbot/following{/other_user}","gists_url":"https://api.github.com/users/orchardbot/gists{/gist_id}","starred_url":"https://api.github.com/users/orchardbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orchardbot/subscriptions","organizations_url":"https://api.github.com/users/orchardbot/orgs","repos_url":"https://api.github.com/users/orchardbot/repos","events_url":"https://api.github.com/users/orchardbot/events{/privacy}","received_events_url":"https://api.github.com/users/orchardbot/received_events","type":"User","site_admin":false},"open_issues":393,"closed_issues":1,"state":"open","created_at":"2015-04-13T19:41:13Z","updated_at":"2015-09-16T16:54:19Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-09-13T23:30:28Z","updated_at":"2015-09-16T16:54:19Z","closed_at":"2015-09-16T16:54:19Z","body":"When adding a projection element to a layout the user can choose a query layout like so:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/3889090/9839602/a7e8c30e-5a7f-11e5-8948-6455d0cfde22.png)\r\n\r\nThis choice gets persisted in the JSON data of the element as the database record ID of the query layout, like so:\r\n\r\n    QueryLayoutId=85\r\n\r\nExporting this element to a recipe, the record ID 85 gets embedded in the JSON in the recipe. When importing to a new site (such as when using the recipe as a setup recipe) the query layout will most likely not have the same record ID, which causes the projection element to fall back to the default query layout.\r\n\r\nThe projection element needs to store the query layout reference by its index which, unlike the DB record ID, will persist across the export/import cycle."}}