Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-40865

Cancel reply on forums after 'Display message content' view, throws NullPointer exception and remain in the form showing a validation error instead

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Verified
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 11.4
    • Fix Version/s: 20.0
    • Component/s: None
    • Labels:
      None
    • Test Plan:
      Hide

      To reproduce the error:

      1. Go to Forums Tool
      2. Click on a Discussion
      3. Click on Display Message Content (All messages from all Conversations in that Discussion show up)
      4. Click on Reply to any message of any Conversation
      5. Click Cancel
      6. Reply Title input field gets emptied and the consequent validation error show up on the client's side
      7. Whereas on the server's side a NullPointerException not related to that field is triggered
      Show
      To reproduce the error: Go to Forums Tool Click on a Discussion Click on  Display Message Content  (All messages from all Conversations in that Discussion show up) Click on  Reply  to any message of any Conversation Click  Cancel Reply Title  input field gets emptied and the consequent validation error show up on the client's side Whereas on the server's side a NullPointerException not related to that field is triggered

      Description

      The exception occurs in:

       

      private boolean didThreadMove() {
      ...
      String message = selectedThreadHead.getMessage().toString();
      ...
      }
      

      called by:

       

        public String processActionGetDisplayThread() 
      

      and initially by:

       

        public String processDfReplyThreadCancel()
      

      because selectedThreadHead is null.

      At step 3 of the testing plan, instead of clicking on a conversation (then the selectedThreadHead is set at this point*), we click on Display Message Content. 
      This path to reach the conversations never sets the threadHead and therefore, when clicking Reply to one of them and later on Cancel, selectedThreadHead is Null and an error occurs in the backend that makes the front end act up (form fields being cleared out and a unrelated validation error being showed).

      *On the other hand, if we follow the other path: clicking a conversation at step 3 calls processActionsDisplayThread() which sets selectedThreadHead = getThreadHeadForMessage(threadMessage) so the problem does not occur in that path when afterwards clicking Reply and Cancel into a Message.

       

      How we solved it:
      We set selectedThreadHead when the user clicks Reply to any of the Messages within the Conversations, since there, we know already which conversation we are currently replying to:

       

      public String processDfMsgReplyMsg() {
      ...
      ++ this.selectedThreadHead = getThreadHeadForMessage(selectedMessage.getMessage());
      return "dfMessageReply";
      }
      

       

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                Assignee:
                ralvarez Raquel Alvarez Ramirez
                Reporter:
                ralvarez Raquel Alvarez Ramirez
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Git Integration