ckan / ckan/ckanext-scheming

Combination of Form Pages and repeating_subfields do not work properly in edit mode.

Open
#385 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
102
Forks
182
PR merge metrics
No merged PRs in 30d

Description

using form pages repeating_subfields causes inconsistency. While adding a new resource works perfectly, for editing the resource, it does not work for those fields with repeating_subfields. The main problem is that the repeating subfields only take the initial value (can be also empty) and after editing the new values do not update.

to reproduce the error:
ckan version: 2.10
ckanext-scheming: latest (installed on 01.07.2023)
scheming.yml -> Try to add one organization and date when creating a new dataset, and then edit these same fields with a new organization and date

```
scheming_version: 2
dataset_type: test
about_url: http://example.com/the-camel-photos-schema

dataset_fields:

- start_form_page:
title: Basic Info
description: Required and core dataset fields

field_name: title
label: Title
preset: title
form_placeholder: eg. A descriptive title

- field_name: name
label: URL
preset: dataset_slug
form_placeholder: eg. my-dataset

- field_name: notes
label: Description
form_snippet: markdown.html
form_placeholder: eg. Some useful notes about the data

- field_name: owner_org
label: Organization
preset: dataset_organization

- start_form_page:
title: Detailed Info
description:
These fields improve search and give users important links

field_name: tag_string
label: Tags
preset: tag_string_autocomplete
form_placeholder: eg. economy, mental health, government

- field_name: citation
label: Citation
repeating_subfields:
- field_name: originator
label: Originator
preset: multiple_text
form_blanks: 3
required: true
- field_name: publication_date
label: Publication Date
preset: date
- field_name: online_linkage
label: Online Linkage
preset: multiple_text
form_blanks: 2

resource_fields:

- field_name: url
label: URL
preset: resource_url_upload

- field_name: name
label: Name
form_placeholder: eg. January 2011 Gold Prices

- field_name: description
label: Description
form_snippet: markdown.html
form_placeholder: Some useful notes about the data

- field_name: format
label: Format
preset: resource_format_autocomplete
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue in CKAN 2.10 with the provided scheming.yml, creating and then editing a dataset containing the organization, date, and citation repeating_subfields. Start by tracing how ckanext-scheming handles form pages and repeating_subfields during edit mode. Done means edited values persist instead of reverting to their initial or empty values.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.