Details
-
Bug
-
Resolution: Fixed
-
Medium
-
5.2.3
-
None
Description
I am currently working on a Confluence plugin that uses a ContentEntityObject subclass (= a UserStatus) and I ran into an issue.
The user can like this ContentEntityObject, and it works when the user is trying to like his or her own content. Problem is, when the content is not his/her own, we get a RuntimeException:
[INFO] [talledLocalContainer] java.lang.RuntimeException: com.atlassian.confluence.userstatus.UserStatus cannot be cast to com.atlassian.confluence.pages.AbstractPage [INFO] [talledLocalContainer] at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) [INFO] [talledLocalContainer] at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:66) [INFO] [talledLocalContainer] at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1.execute(AsynchronousAbleEventDispatcher.java:32) [INFO] [talledLocalContainer] at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:60) [INFO] [talledLocalContainer] at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160) [INFO] [talledLocalContainer] at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79) [INFO] [talledLocalContainer] at com.atlassian.confluence.like.DefaultLikeManager.addLike(DefaultLikeManager.java:88)
That's because of the LikeEvent that is dispatched after the LikeEntity has been created, it seems there is a listener that expects an "AbstractPage" object with this event, which our object is not (here it's an UserStatus).
It doesn't seem very logical to me to be able to like any ContentEntityObject but crash if you try to like something that is not a BlogPost or a Page.
Attachments
Issue Links
- is caused by
-
CONFSERVER-34583 Workbox is incorrectly handling like events
- Closed