ckan / ckan/ckanext-scheming

Change of a single dataset field results in a "technical" activity message

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

Description

Steps to reproduce:
1. Add {
"field_name": "camel_humps",
"label": "Humps",
"validators": "ignore_missing int_validator",
"form_placeholder": "eg. 2"
}
to ckan_dataset.json.
2. Make sure the schema is referenced in *.ini.
3. login as an editor. Make sure activity streams are enabled.
4. Edit a dataset: fill "Humps". Save.
5. Edit the dataset again. Change Humps to a different value. Do not change any other fields.
6. Go to the Activity Stream tab and check the top activity message.

Result: The top message will be ' changed the extra "camel_humps" of the dataset '

Issue: there are no "extra" fields now on the dataset edit page so the user may be confused. Also, the field is called camel_humps instead of Humps.
It might be more appropriate to show a "user updated dataset" message.
This kind of activity message is perfectly fine if scheming extension is not loaded.

![capture1](https://cloud.githubusercontent.com/assets/10136117/19125616/0901423c-8af5-11e6-9346-4e7da8d0e2db.png)

Tested on CKAN 2.5.3 and master ckanext-scheming.

Proposed fix:
1. Add a configuration variable to ini to turn on replacing the "extra" message with a "changed dataset" message
2. If the variable is True, monkey patch CKAN activity string function.

I have a fix ready and tested.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the activity message with the schema entry in ckan_dataset.json and its reference in *.ini. Inspect how the activity stream describes a single schema field change. Done means the message no longer presents the field as an unexplained extra when scheming is enabled, while the existing behavior remains available without the extension.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.