Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-4119

ReadOnlyException upon handling empty value of a MagnoliaRichTextField

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.4
    • Fix Version/s: 5.5.14, 5.6.10, 5.7.3, 6.1
    • Component/s: dialogs
    • Labels:
      None
    • Epic Link:
    • Sprint:
      Foundation 7, Foundation 8, Foundation 9
    • Story Points:
      3
    • Magnolia Release:
      5.5.14, 5.6.11, 5.7.3, 6.1

      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:

      https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/browse/magnolia-ui-vaadin-common-widgets/src/main/java/info/magnolia/ui/vaadin/richtext/MagnoliaRichTextField.java#84

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              asiska Adam Siska
              Reporter:
              mkaiser Michael Kaiser
              Visible to:
              Jennifer Brehm
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 6h 14m
                  6h 14m