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

Document can be searched even if the Doc type is changed and the attribute should not be existing

    Details

      Description

      1) Extract a clean instance of Liferay 6.2 SP16
      2) Start server and login with admin
      3) Navigate to Document and Media portlet
      4) Add document with type 'Contract'.
      5) In Status drop-down, select value - 'In Review'.
      6) Click on publish.
      7) Search for "Review".
      8) the document published will be available in the search result.
      Up-till this point everything is working as expected

      9) Now edit this document.
      10) change document type from contract to - Marketing Banner
      11) select business goal drop down to value - Lead Generation
      12) click on publish
      13) Search for "Review" once again (the attribute which should ideally not exist).

      Observed Behavior: the document is still available in the search result.
      Expected Behavior: the document should not be available in search result as it has been edited and the document type has been changed where 'Review' doesn't exist.

      Cause of the issue is that while creating a new version and changing the document type, it calls
      com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.checkOutFileEntry(long, long, String, long, ServiceContext) (added since LPS-18677)
      The fields for the previous versions are shown because during checkout the DDM field contents are copied from the old version to the new, even when the new version has a different document type with different fields.

      The solution is to prevent the metadata copy when the document types are different.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 44 weeks, 6 days ago

                  Packages

                  Version Package
                  6.2.X EE