-
Bug
-
Resolution: Duplicate
-
Low
-
None
-
6.4.2
-
None
-
Severity 3 - Minor
-
Summary
Cannot access User Profile > Drafts after uninstalling the Confluence Questions plugin due to existing drafts related to this plugin that cannot be converted correctly once the plugin is uninstalled.
Steps to Reproduce
- Install Confluence Questions
- Create a question
- Select a space from "Ask in a space"
- Enter a question title, description, and select a topic
- Before clicking save, a draft will appear in User Profile > Drafts
- Now uninstall the plugin
- Try to access User Profile > Drafts again
Expected Results
- The current drafts the user has will show in the list.
Actual Results
The page shows an error like the one below:
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getBodyAsString' in class com.atlassian.confluence.content.CustomContentEntityObject threw exception java.lang.UnsupportedOperationException: The body of this ContentEntityObject ('') was 'BodyType:XHTML' but was expected to be 'BodyType:RAW' at /users/viewmydrafts.vm[line 47, column 29]
Workaround
A temporary workaround is to delete the draft created for the Confluence Questions plugin from the database.
- Make sure to take a backup copy of the database before running any queries.
- Run the queries below to delete the drafts related to the Confluence Questions plugin:
DELETE FROM contentproperties WHERE contentid IN (SELECT contentid FROM CONTENT WHERE CONTENT_STATUS='draft' AND pluginkey = 'com.atlassian.confluence.plugins.confluence-questions:answer-draft'); DELETE FROM bodycontent WHERE contentid IN (SELECT contentid FROM CONTENT WHERE CONTENT_STATUS='draft' AND pluginkey = 'com.atlassian.confluence.plugins.confluence-questions:answer-draft'); DELETE FROM notifications WHERE contentid IN (SELECT contentid FROM CONTENT WHERE CONTENT_STATUS='draft' AND pluginkey = 'com.atlassian.confluence.plugins.confluence-questions:answer-draft'); DELETE FROM imagedetails WHERE attachmentid IN (SELECT contentid FROM content WHERE pageid IN (SELECT contentid FROM CONTENT WHERE CONTENT_STATUS='draft' AND pluginkey = 'com.atlassian.confluence.plugins.confluence-questions:answer-draft')); DELETE FROM contentproperties WHERE contentid IN (SELECT contentid FROM content WHERE pageid IN (SELECT contentid FROM CONTENT WHERE CONTENT_STATUS='draft' AND pluginkey = 'com.atlassian.confluence.plugins.confluence-questions:answer-draft')); DELETE FROM content WHERE pageid IN (SELECT xid FROM (SELECT c.contentid AS xid FROM content c WHERE CONTENT_STATUS='draft' AND pluginkey = 'com.atlassian.confluence.plugins.confluence-questions:answer-draft') AS x);
- Restart Confluence.
In case you face any constraint problems while running the queries above, please raise a support ticket providing the latest logs and the queries that worked and failed so we can help you.
- duplicates
-
CONFSERVER-56058 Disabling Questions plugin breaks drafts page
-
- Closed
-
- is related to
-
CONFSERVER-55067 Confluence Questions drafts cannot be edited or discarded
-
- Closed
-