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

ReadOnlyException upon handling empty value of a MagnoliaRichTextField

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.5.14, 5.6.10, 5.7.3, 6.1
    • 5.4
    • dialogs
    • None
    • Foundation 7, Foundation 8, Foundation 9
    • 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:

      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.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

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