Uploaded image for project: 'Alfresco'
  1. Alfresco
  2. ALF-21893

Deleting linked document leads to broken destination folder of link


    • Resolution Time Custom Field:
      45 weeks, 5 days, 9 hours, 25 minutes, 43 seconds


      Steps to reproduce:

      1. User 'userA' uploads file 'myFile' from local machine to his home folder.
      2. User 'userA' grants Consumer permission for file 'myFile' to user 'userB'.
      3. User 'userB' creates from file 'myFile' a document link via Copy to -> Create Link. As a destination he selects his (user 'userB') homefolder.
      4. User 'userA' deletes file 'myFile'.
      5. User 'userB' tries to see content of this homefolder through repository. He is unable to list his documents, screen hangs on 'Loading the Document Library...' label.

      Motivation for such user story is, that when one user shares a document with another, it is handy to create a link for that file, so second does not have to remember the path to file in first users folders.

      Technical analysis:
      In the last step of steps to reproduce, browser console shows undefined JS error (please see attached screenshot). Share script documentlist.js is missing a reference to a link source document 'myFile'. This is due to fact, that link source was already deleted by 'userA'. Alfresco core service for document links - org.alfresco.repo.doclink.DocumentLinkServiceImpl registers a behaviour which should delete all links pointing to file which is under delete procedure. This is done by method #deleteLinksToDocument in mentioned class. This method fails to delete these link due to lack of permissions (link is owned by user 'userB'). However this failure is not reflected anywhere so deletion of file 'myFile' ends up successful.

      I see more possibilities to handle such cases. For example: deletion of links should be done under system rights. Or documentlist.js will be adjusted to be able to cope with broken links.


          Issue Links




                • Assignee:
                  closedissues Closed Issues
                  Valus Miroslav (Inactive)
                • Votes:
                  0 Vote for this issue
                  3 Start watching this issue


                  • Created:
                    Date of First Response:

                    Structure Helper Panel