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

Cannot delete an assignment assigned to a gradebook item

    Details

    • Type: Bug
    • Status: Verified
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 19.0
    • Component/s: Assignments
    • Labels:
      None
    • Test Plan:
      Hide
      1. Create an assignment and assign it to a gradebook item (New item or add to existing gradebook item)
      2. Delete the assignment
      3. Confirm the deletion, it will stuck in the same page
      4. Go to the list of assignments, it should be there.
      Show
      Create an assignment and assign it to a gradebook item (New item or add to existing gradebook item) Delete the assignment Confirm the deletion, it will stuck in the same page Go to the list of assignments, it should be there.

      Description

      Cannot delete an assignment that is assigned to a gradebook item.

      23-Aug-2018 02:22:12.884 INFO [http-nio-20013-exec-37] org.sakaiproject.component.gradebook.GradebookExternalAssessmentServiceImpl.lambda$removeExternalAssessment$1 Deleted 0 externally defined scores
      23-Aug-2018 02:22:12.892 INFO [http-nio-20013-exec-37] org.sakaiproject.component.gradebook.GradebookExternalAssessmentServiceImpl.lambda$removeExternalAssessment$1 Deleted 0 externally defined comments
      23-Aug-2018 02:22:12.898 WARN [http-nio-20013-exec-37] org.sakaiproject.cheftool.VelocityPortletPaneledAction.actionDispatch Exception calling method doDelete_assignment java.lang.reflect.InvocationTargetException (Caused by java.lang.IllegalArgumentException: Removing a detached instance org.sakaiproject.tool.gradebook.GradebookAssignment#2)
      java.lang.reflect.InvocationTargetException
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.sakaiproject.cheftool.VelocityPortletPaneledAction.actionDispatch(VelocityPortletPaneledAction.java:740)
      	at org.sakaiproject.cheftool.VelocityPortletPaneledAction.processAction(VelocityPortletPaneledAction.java:552)
      	at org.sakaiproject.cheftool.ToolServlet.doGet(ToolServlet.java:228)
      	at org.sakaiproject.cheftool.VelocityPortletPaneledAction.doGet(VelocityPortletPaneledAction.java:1152)
      	at org.sakaiproject.cheftool.ToolServlet.doPost(ToolServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
      	at org.sakaiproject.vm.ComponentServlet.service(ComponentServlet.java:56)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:426)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:352)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      	at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:513)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1487)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1228)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1062)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:491)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:267)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:155)
      	at org.sakaiproject.portal.charon.handlers.WorksiteHandler.doPost(WorksiteHandler.java:69)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1171)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:475)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:685)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.IllegalArgumentException: Removing a detached instance org.sakaiproject.tool.gradebook.GradebookAssignment#2
      	at org.hibernate.jpa.event.internal.core.JpaDeleteEventListener.performDetachedEntityDeletionCheck(JpaDeleteEventListener.java:69)
      	at org.hibernate.event.internal.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:106)
      	at org.hibernate.event.internal.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:73)
      	at org.hibernate.internal.SessionImpl.fireDelete(SessionImpl.java:956)
      	at org.hibernate.internal.SessionImpl.delete(SessionImpl.java:896)
      	at org.springframework.orm.hibernate4.HibernateTemplate$24.doInHibernate(HibernateTemplate.java:794)
      	at org.springframework.orm.hibernate4.HibernateTemplate.doExecute(HibernateTemplate.java:341)
      	at org.springframework.orm.hibernate4.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:309)
      	at org.springframework.orm.hibernate4.HibernateTemplate.delete(HibernateTemplate.java:787)
      	at org.springframework.orm.hibernate4.HibernateTemplate.delete(HibernateTemplate.java:782)
      	at org.sakaiproject.component.gradebook.GradebookExternalAssessmentServiceImpl.removeExternalAssessment(GradebookExternalAssessmentServiceImpl.java:284)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
      	at com.sun.proxy.$Proxy112.removeExternalAssessment(Unknown Source)
      	at org.sakaiproject.assignment.tool.AssignmentAction.removeNonAssociatedExternalGradebookEntry(AssignmentAction.java:8310)
      	at org.sakaiproject.assignment.tool.AssignmentAction.integrateGradebook(AssignmentAction.java:4957)
      	at org.sakaiproject.assignment.tool.AssignmentAction.doDelete_assignment(AssignmentAction.java:9579)
      	... 57 more
      
      

       

      To reproduce it:

      1. Create an assignment and assign it to a gradebook item (New item or add to existing gradebook item)
      2. Delete the assignment
      3. Confirm the deletion, it will stuck in the same page
      4. Go to the list of assignments, it should be there.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ern Earle R Nietzel
                  Reporter:
                  farreri Miguel Pellicer
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code