-
Bug
-
Resolution: Fixed
-
Neutral
-
6.2.33
-
Empty show more show less
-
Yes
-
Nucleus 38
-
2
-
Yes
The Restore version action throws a null pointer.
Reproduce
- Using the compatibility Pages app create a version of any page (i.e. publish a page).
- Try and restore the version created
Expected
The version selected is restored.
Actual
A null pointer is thrown stacktrace-full.txt
ERROR info.magnolia.ui.contentapp.browser.action.RestoreVersionAction 02.05.2023 13:22:36 -- Restoring of version failed. java.lang.NullPointerException javax.jcr.RepositoryException: java.lang.NullPointerException at info.magnolia.ui.contentapp.browser.action.RestoreVersionAction.createVersionBeforeRestore(RestoreVersionAction.java:197) ~[magnolia-ui-framework-compatibility-6.2.33.jar:?] at info.magnolia.ui.contentapp.browser.action.RestoreVersionAction.restoreVersion(RestoreVersionAction.java:222) ~[magnolia-ui-framework-compatibility-6.2.33.jar:?] at info.magnolia.ui.contentapp.browser.action.RestoreVersionAction.access$800(RestoreVersionAction.java:75) ~[magnolia-ui-framework-compatibility-6.2.33.jar:?] at info.magnolia.ui.contentapp.browser.action.RestoreVersionAction$1.onSuccess(RestoreVersionAction.java:143) [magnolia-ui-framework-compatibility-6.2.33.jar:?] at info.magnolia.ui.dialog.formdialog.FormDialogPresenterImpl$1.onSuccess(FormDialogPresenterImpl.java:146) [magnolia-ui-framework-compatibility-6.2.33.jar:?] ... ... Caused by: java.lang.NullPointerException at info.magnolia.context.RequestAttributeStrategy.setAttribute(RequestAttributeStrategy.java:165) ~[magnolia-core-6.2.33.jar:?] at info.magnolia.context.AbstractContext.setAttribute(AbstractContext.java:114) ~[magnolia-core-6.2.33.jar:?] at info.magnolia.commands.impl.VersionCommand.execute(VersionCommand.java:101) ~[magnolia-core-6.2.33.jar:?] at info.magnolia.ui.contentapp.browser.action.RestoreVersionAction.createVersionBeforeRestore(RestoreVersionAction.java:195) ~[magnolia-ui-framework-compatibility-6.2.33.jar:?] ... 140 more
Workaround
Use the UI6 (aka new) Pages app to restore the version.
Notes
Looking closer the null pointer occurs on Line 195 of RestoreVersionAction where the versionCommand calls execute(). Line 101 of VersionCommand#execute() where setAttribute() is called ultimately throws the null because Line 165 of RequestAttributeStrategy#setAttribute() returns null from getRequest().
Acceptance criteria
1.
|
Implementation | Completed | Jaromir Sarf | |
2.
|
Code review | Completed | Quach Hao Thien | |
3.
|
Pre-Integration QA | Completed | Quach Hao Thien | |
4.
|
QA | Closed | AntonĂn Juran |