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

Changing the current context document does not also change the current context wiki

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Critical
    • None
    • 8.0-milestone-2
    • Old Core
    • None
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Right now we have cases when we set the context document (in displayers for example), but if it turns out that the new context document is from a different wiki than the current one, we have problems (like XWIKI-13084) since all the systems work with the current context wiki, which was left out of sync due to the context document change.

      The proposal is to synchronize/set the context wiki when doing XWikiContext.setDoc(XWikiDocument newContextDoc), thus achieving a 1-way sync between the 2 properties.

      When you restore the context document the context wiki will also be restored (assuming they were in sync to start with). If they were not in sync to start with, then maybe there was an issue already in that code.

      Synchronizing the other way around (syncing the context doc when changing the context wiki) is dangerous and can lead to undesired states.

      On the long run, the 2 properties should be synced completely, by having the context wiki just read the value from the context document, but FTM, we should do it at least 1-way as proposed above.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              enygma Eduard Moraru
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: