Uploaded image for project: 'Lesson Builder'
  1. Lesson Builder
  2. LSNBLDR-940

NPE protection for missing comments section on student page

    Details

    • 12 status:
      Resolved
    • 11 status:
      Resolved
    • Previous Issue Keys:
      SAK-33911
    • Test Plan:
      Hide

      Need database access to the instance testing this on

      Here's how I'm going to test this

      • Add a student page with comments
      • Add some comments from the students
      • Now you have to go into the database
        select * from lesson_builder_student_pages
        And get the commentSection value
      • Go into the database and remove this id from LESSON_BUILDER_ITEMS

      With this patch I'd hope that the student comments still come for this section will still come up. For instance I had this itemId still in lesson_builder_comments but it wasn't in lesson_builder_items. . .

      Show
      Need database access to the instance testing this on Here's how I'm going to test this Add a student page with comments Add some comments from the students Now you have to go into the database select * from lesson_builder_student_pages And get the commentSection value Go into the database and remove this id from LESSON_BUILDER_ITEMS With this patch I'd hope that the student comments still come for this section will still come up. For instance I had this itemId still in lesson_builder_comments but it wasn't in lesson_builder_items. . .

      Description

      Western recently ran into an issue where somehow a student page's comment section was deleted (every student page has a comment section by default). We haven't been able to identify exact steps to reproduce the ability to delete the comments section as a student, but the result was that trying to navigate to the student page in question would throw an uncaught NPE. The stacktrace would take over the entire portal, meaning the user had no way to reset the tool, or navigate back to the site without either manually entering the URL, or closing and re-opening their browser, etc.

      The problem manifests because the ID of the comments section is stored in the student page object. However, when the comments section gets deleted, the ID for it remains in the page object. So when SimplePageBean.getItemsOnPage() runs, it detects that it had an ID for a comments section, asks the service for that item (which returns null), and then it tries to access the ID of this null object to stick in the itemCache map, which throws the NPE.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bjones86 Brian Jones
                Reporter:
                bjones86 Brian Jones
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: