Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037051Openbravo ERPA. Platformpublic2017-10-11 11:012018-01-03 12:38
JONHM 
inigosanchez 
highmajoralways
closedfixed 
5
 
3.0PR18Q1 
alostale
Core
No
0037051: Rich text area fields showed in grid mode could corrupt the visibility of the grid
Rich text area fields showed in grid mode could corrupt the visibility of the grid
1) Create a new column in c_invoice table:
 ALTER TABLE c_invoice ADD COLUMN comment character varying(2000);

2) With a module in development open "Tables and columns" window and select c_invoice column. Press button 'Create Columns from DB'. Open 'comment' column and set its reference to 'Rich Text Area'

3)Then switch to "Windows, tabs and fields" window and select 'Sales Invoice' > Header and create the new column by pressing the button 'Create Fields'. Open 'comment' field and set its sequence number to 75.

4) Compile the application

5) Create some records in "Sales Invoice" window and show the new comment field in grid mode

- OPTION 1:

6.1) Set the comment of one of those records by running the attached query (with your c_invoice_id)


- OPTION 2:

6.2.1) Copy content from some email (from gmail) with no longer than 2000 characters (including HTML tags) into comment field and save the record.

6.2.2) Then modify that content by adding some more text or copying paragraphs


7) When opening again the "Sales Invoice" window, you will see the grid corrupted (see attached image)
As this is a text field which can be copied with format easily by some email content, the HTML tags should be escaped.
No tags attached.
png Screenshot from 2017-10-10 18-34-08.png (153,250) 2017-10-11 11:01
https://issues.openbravo.com/file_download.php?file_id=11166&type=bug
png

? sql_richtextarea (2,065) 2017-10-11 11:05
https://issues.openbravo.com/file_download.php?file_id=11167&type=bug
Issue History
2017-10-11 11:01JONHMNew Issue
2017-10-11 11:01JONHMAssigned To => platform
2017-10-11 11:01JONHMFile Added: Screenshot from 2017-10-10 18-34-08.png
2017-10-11 11:01JONHMModules => Core
2017-10-11 11:01JONHMResolution time => 1506808800
2017-10-11 11:01JONHMTriggers an Emergency Pack => No
2017-10-11 11:05JONHMFile Added: sql_richtextarea
2017-10-11 11:24JONHMSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16051#r16051
2017-10-11 11:35JONHMResolution time1506808800 => 1509490800
2017-10-11 11:36PracticsIssue Monitored: Practics
2017-10-11 12:52inigosanchezStatusnew => scheduled
2017-10-11 12:52inigosanchezAssigned Toplatform => inigosanchez
2017-10-11 13:32PracticsIssue End Monitor: Practics
2017-10-11 17:43inigosanchezReview Assigned To => alostale
2017-10-11 17:57hgbotCheckin
2017-10-11 17:57hgbotNote Added: 0099868
2017-10-11 17:57hgbotStatusscheduled => resolved
2017-10-11 17:57hgbotResolutionopen => fixed
2017-10-11 17:57hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a9040328c3f85086d728e0598bd00f768237f78f [^]
2017-10-13 08:30alostaleNote Added: 0099881
2017-10-13 08:30alostaleStatusresolved => closed
2017-10-13 08:30alostaleFixed in Version => 3.0PR18Q1
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101325

Notes
(0099868)
hgbot   
2017-10-11 17:57   
Repository: erp/devel/pi
Changeset: a9040328c3f85086d728e0598bd00f768237f78f
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Wed Oct 11 17:34:31 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a9040328c3f85086d728e0598bd00f768237f78f [^]

Fixed issue 37051: Rich text area fields causes visibility problems in the grid

The problem was that the rich text area fields generated visibility problems in the grid under some circumstances.
(e.g. when a rich text area field has a carriage return or html tags such as div, br,etc.). A common usecase could
be when a text is copied from a website.

This visibility problems occurred because in form view this type of fields are visualized as a rich text editor and
html tags are supported but in grid view are visualized as a normal field in the grid and this html tags are not
properly handled by SC.

In order to avoid this grid visibility problems, when showing a rich text area field in grid view, now it is escaped
the html code. Visibility in form view is not changed. Now the problem has been fixed by taking account this situation
in getGridFieldProperties method of the RichTextUIDefinition reference.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/RichTextUIDefinition.java
---
(0099881)
alostale   
2017-10-13 08:30   
reviewed

tested: now in grid html tags are seen
(0101325)
hudsonbot   
2018-01-03 12:38   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/c81e0d3cbab5 [^]
Maturity status: Test