Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7142

Can not programatically delete a document located on a diferent wiki than the current one.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.3-milestone-1
    • Fix Version/s: 4.1.4, 4.2-milestone-2
    • Component/s: Old Core
    • Labels:
    • keywords:
      delete document virtual multiwiki
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      XWikiCacheStore.deleteXWikiDoc(XWikiDocument doc, XWikiContext context) uses internally getKey(doc, context) instead of simply getKey(doc).

      The getKey(doc, context) method ignores the document's wiki and uses the context wiki instead. This causes a api.Document.delete() call from velocity (or an XWiki.deleteDocument(...) from java) to delete the wrong document (from the current wiki) if the document to delete is from a different wiki (in a multiwiki environment). Example: someWiki:XWiki.Admin.delete() results in deleting currentWiki:XWiki.Admin.

      A workaround is to change the context database before a delete document call.

      Note: Marked as Critical since it can cause data loss by deleting the wrong pages.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lucaa Anca Luca
              Reporter:
              enygma Eduard Moraru
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: