{"action":"created","issue":{"url":"https://api.github.com/repos/ckan/ckanext-scheming/issues/14","labels_url":"https://api.github.com/repos/ckan/ckanext-scheming/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/ckan/ckanext-scheming/issues/14/comments","events_url":"https://api.github.com/repos/ckan/ckanext-scheming/issues/14/events","html_url":"https://github.com/ckan/ckanext-scheming/issues/14","id":52085688,"number":14,"title":"Feature request: retain extra fields","user":{"login":"florianm","id":762815,"avatar_url":"https://avatars.githubusercontent.com/u/762815?v=3","gravatar_id":"","url":"https://api.github.com/users/florianm","html_url":"https://github.com/florianm","followers_url":"https://api.github.com/users/florianm/followers","following_url":"https://api.github.com/users/florianm/following{/other_user}","gists_url":"https://api.github.com/users/florianm/gists{/gist_id}","starred_url":"https://api.github.com/users/florianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianm/subscriptions","organizations_url":"https://api.github.com/users/florianm/orgs","repos_url":"https://api.github.com/users/florianm/repos","events_url":"https://api.github.com/users/florianm/events{/privacy}","received_events_url":"https://api.github.com/users/florianm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ckan/ckanext-scheming/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-12-16T08:35:12Z","updated_at":"2016-01-25T16:32:56Z","closed_at":null,"body":"Not sure whether this is a bug or a feature, but it seems that enabling ckanext-scheming with a custom schema will, on first saving a dataset with the new schema, delete any existing \"extra\" fields. Even to only retain the existing extra fields to safely migrate data would be helpful - this could be achieved if config settings would toggle the display of existing extra fields and/or form fields."},"comment":{"url":"https://api.github.com/repos/ckan/ckanext-scheming/issues/comments/174570256","html_url":"https://github.com/ckan/ckanext-scheming/issues/14#issuecomment-174570256","issue_url":"https://api.github.com/repos/ckan/ckanext-scheming/issues/14","id":174570256,"user":{"login":"CarlQLange","id":859820,"avatar_url":"https://avatars.githubusercontent.com/u/859820?v=3","gravatar_id":"","url":"https://api.github.com/users/CarlQLange","html_url":"https://github.com/CarlQLange","followers_url":"https://api.github.com/users/CarlQLange/followers","following_url":"https://api.github.com/users/CarlQLange/following{/other_user}","gists_url":"https://api.github.com/users/CarlQLange/gists{/gist_id}","starred_url":"https://api.github.com/users/CarlQLange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarlQLange/subscriptions","organizations_url":"https://api.github.com/users/CarlQLange/orgs","repos_url":"https://api.github.com/users/CarlQLange/repos","events_url":"https://api.github.com/users/CarlQLange/events{/privacy}","received_events_url":"https://api.github.com/users/CarlQLange/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T16:32:56Z","updated_at":"2016-01-25T16:32:56Z","body":"Just in case someone wants this (and I think lots do), here's a copy-pastable solution:\r\n\r\nIn `ckanext-scheming/ckanext/scheming/templates/scheming/package/snippets/package_form.html`\r\n\r\nfrom\r\n\r\n```html\r\n{% block metadata_fields %}\r\n{% endblock %}\r\n```\r\n\r\nto\r\n\r\n```html\r\n{% block metadata_fields %}\r\n  {% block package_metadata_fields_custom %}\r\n    {% block custom_fields %}\r\n      {% snippet 'snippets/custom_form_fields.html', extras=data.extras, errors=errors, limit=3 %}\r\n    {% endblock %}\r\n  {% endblock %}\r\n{% endblock %}\r\n```"}}