Newlines replaced by \n in description - why?

11 views
Skip to first unread message

Marianne

unread,
Apr 10, 2013, 2:48:29 AM4/10/13
to redbo...@googlegroups.com
Hi,

I'm working on the display of the metadata in ReDBox. I have noticed that every time I edit a record, all newlines in the description get replaced by \n. If the record is saved then the \n's are saved as literals in the description field. This seems to be a bug to me - if I don't want the \n's being embedded in the description then who ever is doing the Final Review check needs to go though the description and find all "\n" and replace with actual carriage returns before publishing (and then never ever edit the record again). 

Is there a reason why the newlines are replaced?  Has anyone else noticed this?

I've checked the code and the replacement happens when portal/default/redbox/workflows/dataset.vm calls a DatasetData method called getJsonMetadata (line 183 in portal/default/redbox/scripts/workflows/dataset.py). The comment in the code is "fix newlines" but I don't know why they need to be "fixed".

Can anybody shed some light on this?

Thanks!

Marianne

Marianne

unread,
Apr 11, 2013, 1:50:59 AM4/11/13
to redbo...@googlegroups.com
Checked against a default build and this error seems to have crept in with one of our local changes. Everyone can ignore this problem as it is special to JCU :) *sigh*

Cya!

Marianne

unread,
Apr 11, 2013, 9:26:01 PM4/11/13
to redbo...@googlegroups.com
Okay - so we changed the description text box into a widget similar to the one used by Notes - and our problem with our description field is present in the Notes field. 

I have logged this issue on the ReDBox issue tracker (https://github.com/redbox-mint/redbox/issues/36)
Reply all
Reply to author
Forward
0 new messages