Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-61856

Unselecting a multi-select field is not possible when editing a web content

    Details

      Description

      Steps to reproduce

      1. Create a web content structure with a select field, the field should be multiple choice
      2. Add a template for this structure
      3. Create a web content with this structure, add a title and select any of the options in the select field
      4. Publish
      5. Edit this web content
      6. Unselect the previously selected option (ctrl+click)
      7. Publis it and Edit

      Expected behaviour

      No one option should be selected

      Actual behaviour

      The previously selected option is selected

      additional info

      On master creating a web content structure is impossible, so it can not be reproduced.
      However it can be easily reproduced on 6.2.x and the code clearly shows that the bug exists

      root cause

      The root cause is in DDMImpl.java, mergeFields method.
      The merge walks through the new fields and and adds it to the existing fields if it is new and return with the updated existing fields.
      However, in our case, a field is missing from new fields, so it should be removed from existing fields, but the algorithm does not take it into account.

      hint for fixing

      When removing a field from existing fileds take into account, that non-localizable fields are not in the request, so non-localizable fields should not be deleted from existingfields. The reason, why non-localizable fields are not in the request is that when they showed during adding translation they are simple html texts, not read-only fields.

        Attachments

        1. Fixed.PNG
          Fixed.PNG
          51 kB
        2. Reproduced.PNG
          Reproduced.PNG
          51 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 36 weeks, 1 day ago

                  Packages

                  Version Package
                  6.2.X EE