This affects Confluence 2.2.x and the current HEAD.

      Renaming a page with a link to itself fails with either a useless warning (in 2.2.x) or a 500 error (in HEAD):

      Invocation of method 'hasChildren' in class com.atlassian.confluence.pages.Page threw exception class net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection: collection was evicted.

      This is caused by an earlier exception, shown only in the logs:

      doSaveEditPageBean: An error occured while storing the requested page!
      com.atlassian.confluence.core.persistence.confluence.StaleObjectStateException: The version of the object to be saved was more than the previous version!

      This is caused by the link refactoring.

      The refactoring process runs before the page title change is done. It updates the link destination, saves the page and increments the version number. The page title is then modified, and the original version number incremented. When this operation attempts to save, the save cannot go ahead with a version number clash and a StaleObjectStateException is thrown.

      I think a possible solution might be to retrieve the current version of the page immediately before saving, rather than storing it in a local variable. This will return the value from the Hibernate cache, and prevent the underlying error.

      I'm not sure why the error is a 500 in HEAD, but handled normally in 2.2. This needs further investigation, as it might affect exception handling in other areas.

      An obvious workaround to this problem is to remove the page's link to itself. Renaming can then proceed normally.

          Form Name

            [CONFSERVER-7373] Cannot rename a page with a link to itself

            Katherine Yabut made changes -
            Workflow Original: JAC Bug Workflow v3 [ 2874760 ] New: CONFSERVER Bug Workflow v4 [ 3004847 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2802744 ] New: JAC Bug Workflow v3 [ 2874760 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow [ 2733028 ] New: JAC Bug Workflow v2 [ 2802744 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2398385 ] New: JAC Bug Workflow [ 2733028 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 2296260 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2398385 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2232017 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 2296260 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2191586 ] New: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2232017 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 1927615 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2191586 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v3 [ 1728794 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 1927615 ]
            Katherine Yabut made changes -
            Workflow Original: CONF Bug Subtask WF (TEMP) [ 1686077 ] New: Confluence Workflow - Public Facing - Restricted v3 [ 1728794 ]

              Unassigned Unassigned
              matt@atlassian.com Matt Ryall
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: