-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
When creating version info.magnolia.cms.core.version.BaseVersionManager#createVersion checks if maxVersionIndex is set to negative number. If yes then it doesn't create new version, but instead of it createVersion method just return root version.
node.getVersionHistory().getRootVersion();
It doesn't get version history from node in version workspace. So it will fail on UnsupportedRepositoryOperationException. If we change code to something like
VersionHistory versionHistory = getVersionHistory(node); return versionHistory != null ? versionHistory.getRootVersion() : null;
then it will get version history from node in version workspace, but if we use versioning before activation then ActivationCommand will try to activate "jcr:rootVersion" version. Instead of activating jcr:rootVersion version(which fails) it should activate current state of node.
So if can't create version then we shouldn't return "jcr:rootVersion" from method createVersion but instead of it we should simply return null and handle with this state.
- is related to
-
MAGNOLIA-5616 Restore of a deleted page is not possible
- Closed