[MAGNOLIA-5633] Wrong behaviour during creating version when maxVersionIndex is set to negative number Created: 22/Jan/14 Updated: 23/Jan/14 Resolved: 23/Jan/14 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Milan Divilek | Assignee: | Milan Divilek |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Description |
|
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. |