Problems with versioning


In N2 version 2.4.7 a problem with saving previews/unpublished versions occured. Saving the previews worked ok, but when trying to save additional changes to a draft version, the system yields "The item couldn't be saved. Please look at the following: Another item already has the name 'whatever-url'."This was fixed in v 2.4.8, but sadly the very useful orange dot showing that a draft exists was no longer visible in the navigation tree. Upgrading to 2.4.9 solved the issue with the missing dot, but also reintroduces the defect in the versionining functionality.
Closed Apr 9, 2013 at 5:05 AM by bherila


faester wrote Nov 29, 2012 at 9:34 AM

I've looked into this some more.

The problem with saving a preview second time arises when the ContentItem is decorated with [WithAditableName].

In the NameEditor's Validate method the IntegrityManager.IsLocallyUnique is called.

This is turn delegates to ContentItem.Equals, where the id's is used for testing if the name clashes with another existing item. The test here should in this particular circumstance return true for
id == 0 && other.id == 0 && VersionIndex != other.VersionIndex
since it - as far as the NameEditor is concerned - is effectively the same object albeit versioned differently.

But introducing this test breakes any meaningful semantics in the Equals-method, so another code path is probably needed.

PS: Please forget about the N2 versions mentioned above. The problem exists in both 2.4.7, 2.4.8 and 2.4.9

faester wrote Nov 29, 2012 at 12:04 PM

I have placed a pull request on github. This may have some issues, but can hopefully be used as a quickfix.

taj wrote Dec 6, 2012 at 8:54 AM

I also have a similar problem with Drafts and its pretty annoying that you can't Save the draft again and again.
I have tried almost every version of 2.4.x.x up to and none of them works. What

(It has been working in version where you could have multiple Drafts).