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

Assignments created without due/open dates set cause NPE in the UI

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 12.0, 12.3, 19.0
    • Fix Version/s: 12.3, 19.0
    • Component/s: Assignments
    • Labels:
      None
    • 12 status:
      Resolved
    • Test Plan:
      Hide

      Please add a Test Plan here.

      Show
      Please add a Test Plan here.

      Description

      In the assignments tool, some process is able to create assignments bypassing the open/due/close dates being set. I'm not sure yet if this is via lessons, via import or via template (my best guess).

      Someone today on nightly did it and a few of our clients have done it. This results in the UI error:

      VelocityViewServlet : Error processing a template for path ''
      Invocation of method 'getAssignmentStatus' in class com.sun.proxy.$Proxy192 threw exception java.lang.NullPointerException at /vm/assignment/chef_assignments_list_assignments.vm[line 427, column 78] 
      java.lang.NullPointerException
      

      This is because there is no NPE checks in getAssignmentStatus for open/due (there is for close) and also in the method getAssignmentCannonicalStatus. Ideally these would be checked to avoid this error, but also whatever is inserting these incorrectly should probably also be discovered so nulls don't end up in the database.

      I fixed this for the client by just setting all the open dates to now, and all of the close/due to a week out similar to the UI.

      create temporary table assignment_null_updates select assignment_id from asn_assignment where open_date is null and close_date is null and due_date is null;
      
      update asn_assignment set open_date = now(), due_date = date_add(now(), interval 7 day), close_date = date_add(now(), interval 7 day) where assignment_id in (select assignment_id from assignment_null_updates);
      
      drop table assignment_null_updates;
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jcebellan Jose Cebellán (Entornos de Formación)
                  Reporter:
                  jonespm Matthew Jones
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code