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

DLFileEntry becomes inconsistent in case of calling DLFileEntryServiceImpl.moveFileEntry with a folderId of a different groupId

    Details

      Description

      DLFileEntry becomes inconsistent in case of calling DLFileEntryServiceImpl.moveFileEntry with a folderId of a different groupId.
      Generated inconsistence: DLFileEntry.folderId will point to a DLFolder that has a different groupId than DLFileEntry.groupId

      Steps to reproduce

      1. Create two sites: Site1 and Site2
      2. Create a DLFileEntry in Site1
      3. Query database in order to obtain dlfileentryid of created document
      4. Create a DLFolder in Site2
      5. Query database in order to obtain folderId of created folder
      6. Execute following groovy script:
        try {
        //long userId = Long.parseLong(userInfo.get("liferay.user.id"));
        long  dlFileEntryId = <id of created DLFileEntry>;
        long newFolderId = <id of created DLFolder>;
        com.liferay.document.library.kernel.service.DLFileEntryServiceUtil.moveFileEntry(dlFileEntryId,newFolderId ,new com.liferay.portal.kernel.service.ServiceContext() );
        }
        catch(Throwable t) {
        t.printStackTrace(out);
        t.printStackTrace();
        }
        
      7. Result:
        • Expected behaviour: An error is thrown and document is not moved
        • Wrong behaviour: Script is executed without error but DLFileEntry disappears from both origin and destination folder

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sylvia.luan Sylvia Luan
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 38 weeks, 4 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP SP2
                  7.0.0 DXP FP13
                  7.0.0 DXP SP3
                  7.0.3 CE GA4
                  7.1.X
                  Master