Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netlify CMS shows empty category when category is a string #235

Open
timwis opened this issue Feb 6, 2023 · 0 comments
Open

Netlify CMS shows empty category when category is a string #235

timwis opened this issue Feb 6, 2023 · 0 comments
Labels

Comments

@timwis
Copy link
Owner

timwis commented Feb 6, 2023

JKAN supports two types of values for a dataset's category: a string (for a single category), or an array of strings (for multiple categories).

name: City Budget
category: Finance
name: Bicycle Lanes
category:
  - Transportation
  - Planning / Zoning

Netlify CMS is configured to allow multiple values for this field. Unfortunately, it seems that if you edit a dataset with a string value (as in the first example above), the UI shows the field as blank.

Fortunately, if you save, it keeps the existing category value (unless you change the category), so it won't lose the value, but it can be confusing for users.

It would be great if we could submit a PR to Netlify CMS to fix this. But in the meantime, it might be worth adding a linter of some sort to JKAN to enforce a schema. We could also add it to a jekyll upgrade-jkan CLI (to fix any string values).

EDIT: I previously thought this would silently drop existing category values, but I've confirmed that it doesn't.

@timwis timwis added the bug label Feb 6, 2023
@timwis timwis changed the title Netlify CMS silently loses category when editing dataset with a single category Netlify CMS shows empty category when category is a string Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant