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

HTML code for double quotes appear in field history when text field is updated #21

Open
eprager412 opened this issue Dec 6, 2023 · 3 comments
Assignees
Milestone

Comments

@eprager412
Copy link

eprager412 commented Dec 6, 2023

Describe the bug
HTML code for double quotes appear in field history when text field is updated

To Reproduce

  1. Open attached form in mode /single/fs/
    history_html_simple.txt

  2. In the Additional Comments field, type "ddd", tab off the field and open query widget
    3: History displays Value changed from quotequote to quotedddquote
    Expected behavior
    History displays Value changed from "" to "ddd"

Screenshots
history_html
history_html2

**Browser and OS **
Windows/Chrome

@pbowen-oc pbowen-oc added this to the Next milestone Dec 6, 2023
@MartijnR
Copy link
Member

MartijnR commented Dec 21, 2023

Ignore the below. I was for some reason thinking this happened when editing an existing record.

curl --user enketorules: -d \
"server_url=http://localhost:3000&form_id=language.test&ecid=a&lang=de&instance=\
<data xmlns:OpenClinica= \"http://openclinica.com/odm\" xmlns:enk= \"http://enketo.org/xforms\" xmlns:jr= \"http://openrosa.org/javarosa\" xmlns:oc= \"http://openclinica.org/xforms\" xmlns:orx= \"http://openrosa.org/xforms\" id= \"language.test\" version= \"1\">\
    <page1>\
        <locale_note />\
        <yn1 />\
        <locale_note_comment oc:queryParent= \"locale_note\" />\
        <yn1_comment oc:queryParent= \"yn1\">\
    {\"queries\":[{\"type\":\"comment\",\"id\":\"1\",\"date_time\":\"2023-01-18T11:34:36.608-05:00\",\"comment\":\"\\\"img1.png\\\" to \\\"img2.png\\\"\",\"status\":\"new\",\"assigned_to\":\"\",\"notify\":false,\"thread_id\":\"50b52cae-6c5b-4d1a-ab70-3e05b31e3784\"}]}</yn1_comment>\
    </page1>\
<meta>\
        <instanceID>uuid:e1623dbf-bf87-4b2a-8a5a-85ae832f31f3</instanceID>\
    </meta></data>\
&instance_id=123" http://localhost:8005/oc/api/v1/instance/edit

@pbowen-oc
Copy link

@theywa - Can you work on this?

@theywa
Copy link

theywa commented Jan 3, 2024

@pbowen-oc Sure, I just created a PR for the fix.

Hi @MartijnR, I just created a PR to fix the issue. Can you review it in your spare time? Thanks
I found this issue happens only on new audit query where the string encoded after proceced by the translator code

comment = t('widget.dn.valuechange', {
new: "${this._getLabelForSelectValue(currentValue)}",
previous: "${this._getLabelForSelectValue(previousValue)}",
});

so I put the decode function to reset it back.

@MartijnR MartijnR transferred this issue from OpenClinica/enketo-express-oc May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants