[MGNLUI-4119] ReadOnlyException upon handling empty value of a MagnoliaRichTextField Created: 12/Jan/17 Updated: 18/Sep/19 Resolved: 18/Apr/19 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | dialogs |
| Affects Version/s: | 5.4 |
| Fix Version/s: | 5.5.14, 5.6.10, 5.7.3, 6.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Michael Kaiser | Assignee: | Adam Siska |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 6h 14m | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Template: |
|
||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||||||
| Date of First Response: | |||||||||||||||||
| Visible to: |
Jennifer Brehm
|
||||||||||||||||
| Epic Link: | Support | ||||||||||||||||
| Sprint: | Foundation 7, Foundation 8, Foundation 9 | ||||||||||||||||
| Story Points: | 3 | ||||||||||||||||
| Description |
|
In a custom content app, we are using MagnoliaRichTextField in the detail sub-app. When a user tries to open a previous version of a record and the text field was empty in this version of the record, an exception is thrown. From what I gather, the conflict is between these two statements: and the following line in com.vaadin.ui.AbstractField#setValue(T, boolean): if (!SharedUtil.equals(newFieldValue, getInternalValue())) { // Read only fields can not be changed if (isReadOnly()) { throw new Property.ReadOnlyException(); } ... The problem seems to be that the value is supposed to be set to null but the field is already initialized with "". Since these values are not the same, the ReadOnlyException is triggered. |
| Comments |
| Comment by Samuel Kohler [ 23/Nov/18 ] |
|
Hi everyone Regards, |
| Comment by Jonathan Ayala [ 21/Dec/18 ] |
|
This is happening when RichTextField is marked as readOnly. During field creation, the following lines are executed: info.magnolia.ui.vaadin.richtext.MagnoliaRichTextField.changeVariables(Object, Map<String, Object>) ... if(isEmpty()) { this.setValue(null, true); } ... readOnly property should be checked before setting the value. |
| Comment by Adam Siska [ 26/Mar/19 ] |
|
Found other glitches related to Show versions dialog: First, text within combo box has transparent color: Second, when any demo tour with some publish history is chosen, when click on any version in Show versions dialog, exception is thrown and opened subapp didn't get focus: EDIT: Second issue is caused by selections in Tour types and/or Destinations. |