cht-core icon indicating copy to clipboard operation
cht-core copied to clipboard

`content_type` property is weird

Open mandric opened this issue 8 years ago • 4 comments

I think this property should be removed because:

  • we moved the form to an attachment that has the content type specified on the attachment, so this data is redundant.
  • it's confusing because it seems like a property that applies to the whole record when it only applies to the form, if anything rename it to form_content_type?

mandric avatar Mar 30 '17 17:03 mandric

hi frand @mandric, please triage before the end of this sprint.

nice-snek avatar Jul 04 '17 07:07 nice-snek

This is used in places to determine logic. Renaming it is out of the question (think of the children / migration) unfortunately, because I agree that it's not well named.

I think it's reasonable to look at the attachment content type instead. We only use the current property when it's xml anyway, so this would roughly be a change from:

if (doc.content_type === 'xml') {

to

if (doc._attachments && doc._attachments.content && doc._attachments.content.content_type === 'application/xml') {

Which is quite a lot more painful unfortunately.

Anyway, I'm happy if someone wants to do this, so we can let it live for another Needs Triage cycle.

If no one feels like doing it in that time, then I think it's something we'd naturally deal with if we ever expand out to another content type option.

SCdF avatar Sep 14 '17 14:09 SCdF

Hi @vimemo,

This ticket has not been touched in 90 days. Is it still relevant?

Please also ensure this ticket has a Priority, Status and Type label.(See triaging old issues for more detail)

medic-bot avatar May 23 '18 16:05 medic-bot

Keeping this at the same low priority.

vimemo avatar May 25 '18 20:05 vimemo