Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-20741

The fix provided on MNT-18806 is only working on cm:content type, it is not working on custom subtypes of cm:content

    Details

      Description

      Description

      The fix provided on MNT-18806 is only working on cm:content type, it is not working on custom subtypes of cm:content

      Steps to reproduce
      1. Install RM 2.7.2 and import the custom model (attached)
      2. Import a file and change type to my:doc
      3. Create a copy after this newly imported file
      4. Classify the original file then delete it
      5. Download the file copied at step 3

      Observed Behaviour
      If the classified original file is deleted, the copy made after it can't be downloaded

      Reason: when deleting the file, it removes the physical bin for the copy as well

      Expected Behaviour
      Should be possible to download the copy made after the classified original file, even if it's deleted

      Additional Information
      Customer's workaround:

      In library(.jar) alfresco-rm-community-repo-2.7.2.jar was added ContentBinDuplicationUtility.java to fix original problem.

      We uses Enterprise version of RM module alfresco-rm-enterprise-repo-2.7.2.jar which extends community version of ContentBinDuplicationUtility and classes is EnterpriseContentBinDuplicationUtility.java

      This class implement method public void duplicateIfRequired(NodeRef nodeRef). Code inside check if duplication is needed.

      Original code is:

      if (nodeService.getType(nodeRef).equals(ContentModel.TYPE_CONTENT) && 
      (!nodeService.getTargetAssocs(nodeRef, ContentModel.ASSOC_ORIGINAL).isEmpty() || 
      !nodeService.getSourceAssocs(nodeRef, ContentModel.ASSOC_ORIGINAL).isEmpty()) && 
      !nodeService.hasAspect(nodeRef, ASPECT_RECORD) && 
      !nodeService.hasAspect(nodeRef, ASPECT_SECURED)) 
      { 
      duplicate(nodeRef); 
      } 
      

      Main problem is with part of condition

      "nodeService.getType(nodeRef).equals(ContentModel.TYPE_CONTENT)"

      which checks on node if it is strictly cm:content and this condition not handle custom models.
      We fix it temporarily by change part of condition by

      "dictionaryService.isSubClass(nodeService.getType(nodeRef), ContentModel.TYPE_CONTENT)"

       

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  apetrache Alin Petrache [X] (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel