ckanext-scheming icon indicating copy to clipboard operation
ckanext-scheming copied to clipboard

Resource creation: "will be guessed automatically" tip lost for Format field

Open Chealer opened this issue 5 years ago • 1 comments

When creating a resource with ckanext-scheming 1.2.0, a field for the Format shows. When ckanext-scheming is not installed, a tip tells users "This will be guessed automatically. Leave blank if you wish". But when it is, this helpful tip does not show. It would be nice to keep it.

I did not verify that this persists in version 2, but by looking at \templates\package\snippets\resource_form.html I assume it does. The basic_fields block is overridden, and that tip is not included in ckanext-scheming.

I am not sure how to restore it given the way basic fields are handled:

  {%- for field in schema.resource_fields -%}
    {%- if field.form_snippet is not none -%}
      {%- snippet 'scheming/snippets/form_field.html',
        field=field, data=data, errors=errors,
	entity_type='dataset', object_type=dataset_type -%}
    {%- endif -%}
  {%- endfor -%}

Chealer avatar May 20 '20 15:05 Chealer

@Chealer it seems this behavior is intentional.

https://github.com/ckan/ckanext-scheming/commit/4e09fcfbb0864c52034c4b91171ab44429d27768

Just implement the reverted change on your extension to get this in your implementation.

jqnatividad avatar Nov 25 '20 17:11 jqnatividad