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

Newlines replaced by "\n" in Notes field #36

Open
marianneb opened this issue Apr 12, 2013 · 1 comment
Open

Newlines replaced by "\n" in Notes field #36

marianneb opened this issue Apr 12, 2013 · 1 comment
Labels

Comments

@marianneb
Copy link

There is a bug in the widget used in the notes form that causes carriage returns to be replaced by "\n".

To reproduce:

  • Create a dataset and add a working note containing the following

    Hello!
    How are you?
    
  • Save the note and then save and close the record.

  • Edit same record again. View note - it will now look like this

    Hello!\nHow are you?
    

I have tested this on the current demo redbox install (1.6-RC01-SNAPSHOT). See http://demo.redboxresearchdata.com.au/redbox/default/detail/9cdb842db8449570159627376b225d17/ for a record where this has happened.

@ozej8y ozej8y closed this as completed Oct 8, 2013
@ozej8y ozej8y reopened this Oct 8, 2013
@ozej8y
Copy link
Contributor

ozej8y commented Oct 8, 2013

I have a fix for this issue.

At JCU we altered our description field to support many descriptions with a type and value. This is the only 'list' field in the framework that allows you to enter newlines '\n'.

In widgets2.js, the restore() processes each single instance field with this code.

                    t.val(data[v].replace(/\\n/g,"\n")).trigger("onDataChanged");

When processing all list fields the .replace(/\n/g, "\n") does not exist, so the '\n' is displayed on the screen instead of the newline character.

So here is my fix:

                    input.val(data[v].replace(/\\n/g,"\n")).trigger("onDataChanged");       line: 1634

This is based on the 1.6.1 release.

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

2 participants