Warn when using deprecated db-object appearance

Hi, I’ve been working on this cht-conf issue filed by @jkuester.

Is this the expected outcome in terms of the deprecation warnings?

On replacing db-object appearance with select-contact:

Also, is this the best place to carry out such discussions or should I post questions in the issue thread/PR?
Thanks.

1 Like

Hi @apoorvapendse

Thanks for noticing this!
The forum is the right place for … everything :slight_smile:
In this case, because it’s a specific code problem, we will open an issue in GitHub. Since this is about the default config, can you please open an issue in the cht-core repo and tag as a default config bug?

Thanks a lot! Really appreciate your attention to this detail.

2 Likes

Thanks @diana!
Sorry for not providing context, but the issue I am working on aims to introduce this deprecation warning with the use of db-object, which wasn’t present earlier.
The screenshot is meant to verify that the change works.

I’ll file an issue in cht-core and create a draft PR for the mentioned issue if the changes meet expectations.

Hi @apoorvapendse! To echo what Diana said, the forum is always a good place to post things (especially if you are not sure where else they belong). That being said, for specific issues that already existing in a repo it is fine to just add a comment to the issue thread in GitHub. That does help keep the conversation about the issue in a central place. (And, generally speaking folks are pretty responsive both here on the forum and on GitHub.)


Precisely! This looks to be working as desired! One thing I noticed from looking at your screenshots that I missed in the design of the initial issue is that the warning header message is now inaccurate. Previously this code was only detecting horizontal or compact. Now that the validation is more generalized, can you update the warning header to be a more generic message:

`Form at ${xformPath} contains fields with a deprecated appearance. Please update the following:`

Once that is done and you have got the unit tests working, please raise a PR for this!


:heart: This would also be super helpful! I suspect there are a number of forms in that default config that are still using the db-object appearance. It would be great to get these updated to the recommended configuration.

Just one tip when it comes to uplifting forms to use select-contact, you can find the docs here. But basically for the form to work you will need to update both the appearance column (from db-object to select-contact) AND the type column. The type changes from db:{{contact_type}} to just be string. Then, you need to add an additional value in the appearance column (it is a space-separated list) that is type-{{contact_type}}. For example, if you start with:

type appearance
db:person db-object

This should be updated to:

type appearance
string select-contact type-person

Thanks for taking out the time to write such a detailed reply, I appreciate it.

I’ve opened a PR for this after going through your suggestion, would love to hear your initial thoughts.

I’ll open the follow-up issue on cht-core shortly.
Would it be alright if I quote your observation on type in the issue description as I found it quite helpful.

Thanks again @jkuester and @diana!

1 Like

:+1: Sounds good! I have added myself as a reviewer for that PR. (Should be able to go through it tomorrow.)

And yes, feel free to just copy that context I added about the type stuff and/or just include a link over to this thread.

1 Like

Opened Replace usage of `db-object` appearance with `select-contact` · Issue #9915 · medic/cht-core · GitHub

3 Likes