When a comment contains an 'enter' it is not possibl

Posted by Aede Hoekstra on 05-Jul-2016 07:30

Rollbase version 4.1.0.0 private cloud

I have an object with the possibility to log comments. When the text of the comment contains an "enter" it is not possible to edit the comment. Is this a known error?

comment:

error:

stack:

Uncaught SyntaxError: Invalid or unexpected token
rb-ui.js?v=4.1.0.0:815 Page Localization Details - Set Culture: 821364_267315-nl


commentEdit.jsp?objName=contract&id=833946&commId=88656:677

Uncaught TypeError: Cannot read property 'focus' of undefined(anonymous function) @ commentEdit.jsp?objName=contract&id=833946&commId=88656:677c @ jquery.min.js?v=4.1.0.0:3fireWith @ jquery.min.js?v=4.1.0.0:3ready @ jquery.min.js?v=4.1.0.0:3H @ jquery.min.js?v=4.1.0.0:3

Posted by Santosh Patel on 15-Jul-2016 03:39

Thank you for reporting this bug. Happens in the new UI only.

While this is fixed officially, here is a workaround that you can use:
In file commentEdit.jsp (<path_to_tomcat>/webapps/prod/m/commentEdit.jsp)

look for a section with the following content

<script>
...
	"value" : "<textarea rows=10 cols=92 name='comment'><%=HtmlUtil.encode(comm != null ? comm.getComment() : "")%></textarea><br><span class='rbs_alertMsg' id='comment_error'></span>"
...
</script>

and replace it with this

<script>
...
"value" : `<textarea rows=10 cols=92 name='comment'><%=HtmlUtil.encode(comm != null ? comm.getComment() : "")%></textarea><br><span class='rbs_alertMsg' id='comment_error'></span>` ...
</script>

i.e. replace the value's enclosing double-quotes with back-ticks. Do this for all occurrences of commentEdit.jsp (master and all prods)
That should do the trick. Let me know if this works for you.

All Replies

Posted by Santosh Patel on 15-Jul-2016 03:39

Thank you for reporting this bug. Happens in the new UI only.

While this is fixed officially, here is a workaround that you can use:
In file commentEdit.jsp (<path_to_tomcat>/webapps/prod/m/commentEdit.jsp)

look for a section with the following content

<script>
...
	"value" : "<textarea rows=10 cols=92 name='comment'><%=HtmlUtil.encode(comm != null ? comm.getComment() : "")%></textarea><br><span class='rbs_alertMsg' id='comment_error'></span>"
...
</script>

and replace it with this

<script>
...
"value" : `<textarea rows=10 cols=92 name='comment'><%=HtmlUtil.encode(comm != null ? comm.getComment() : "")%></textarea><br><span class='rbs_alertMsg' id='comment_error'></span>` ...
</script>

i.e. replace the value's enclosing double-quotes with back-ticks. Do this for all occurrences of commentEdit.jsp (master and all prods)
That should do the trick. Let me know if this works for you.

Posted by Aede Hoekstra on 18-Jul-2016 03:45

Hi Santosh,

Thanks for the workaround, We'll try this on our development enviroment.

Posted by Aede Hoekstra on 19-Jul-2016 07:58

To confirm, this workaroud works!

This thread is closed