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

    • delete document virtual multiwiki
    • Unknown
    • N/A
    • N/A

    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

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

              Dates

                Created:
                Updated:
                Resolved: