Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-3652

TreeNode lookup problem with flushed course cache

    XMLWordPrintable

    Details

      Description

      How to reproduce

      • Create a course with a test
        • Add a group to the test
        • Open Assessment tool
        • Select "Groups" in the segments navigation
        • Select a specific group in the group list
      • Now, got system administration
        • Open System -> Caches
        • Clear the "CourseFactory" cache
      • Select the still opened course in the top navigation
      • Select a course node in the left menu 
      • => NOK: error shows up that the course node has been deleted (which is not the case)

       

      The problem can be traced down to TreeHelper.findNodeByUserObject() where the the two nodes are compared using 

      node.getUserObject().equals(userObject)

      The problem is that userObject is the node loaded from the (newly loaded) course while node is the one taken from the menu tree user object. They represent the same object, but have different object identities. 

       

      A solution could be to override GenericNode.equals() method with something that returns true for objects where node.getIdent() is the same. However, this could have severe side effects, it is unclear if there is code that builds upon the fact that the equals method is not implemented. 

      Another solution could be to check if the user object is of type INode and if so cast and compare the ident of the two objects instead of the object identity.

       

      The bug could also be responsible for other, not reproduceable strange errors that happen in the context of menu trees objects.

       

       

        Attachments

        1. 1 prepare group navigation.png
          1 prepare group navigation.png
          509 kB
        2. 2 clear cache.png
          2 clear cache.png
          794 kB
        3. 3 error.png
          3 error.png
          391 kB

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            gnaegi Florian Gnägi
            Tester:
            Mandy Menzel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m