Crash viewing a Section, when all sheets are hidden

Bug #913055 reported by timmyclub
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool Gradebook
Fix Released
Critical
Alan Elkner

Bug Description

I have only the sample data in SchoolTool. Have created a Report Sheet, deployed it. It worked fine. I then decided to test the 'Hide' function and found that I was no longer to able to get an overview of any section...

An internal server error has occurred. This most likely means that you have found a bug in SchoolTool. Please report it on the issue tracker.

Exception
TypeError: ('Could not adapt', None, <InterfaceClass schooltool.gradebook.interfaces.IGradebook>)

Traceback
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 132, in publish
  result = publication.callObject(request, obj)
File "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py", line 207, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 107, in mapply
  return debug_call(obj, args)
Extra information: <schooltool.skin.flourish.zcml_content.FlourishSectionView_index.html object at 0xf0686ac>
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 113, in debug_call
  return obj(*args)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 71, in __call__
  result = self.render(*args, **kw)
File "/usr/lib/python2.7/dist-packages/z3c/form/form.py", line 158, in render
  return self.template()
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
  sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations)()
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/main.pt"
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
  self.do_optTag(stuff)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 518, in do_optTag
  return self.no_tag(start, program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 513, in no_tag
  self.interpret(program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
  structure = self.engine.evaluateStructure(expr)
File "/usr/lib/python2.7/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/main.pt", line 72, column 8
  Expression: <PathExpr standard:u'view/page_template|nothing'>
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
  sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations)()
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/page.pt"
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 583, in do_setLocal_tal
  self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/usr/lib/python2.7/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/page.pt", line 3, column 0
  Expression: <PathExpr standard:u'view/providers/page_refine|nothing'>
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/content.py", line 59, in __call__
  return self.render(*args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 100, in render
  result = ViewletManager.render(self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/viewlet.py", line 140, in <lambda>
  render = lambda self, *args, **kw: self.template(*args, **kw)
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/common/inlinept.py", line 111, in __call__
  showtal=getattr(instance.request.debug, 'showTAL', False),
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 821, in do_loop_tal
  self.interpret(block)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
  self.do_optTag(stuff)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 518, in do_optTag
  return self.no_tag(start, program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 513, in no_tag
  self.interpret(program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 583, in do_setLocal_tal
  self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/usr/lib/python2.7/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "None", line 3, column 10
  Expression: <PathExpr standard:'viewlet'>
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/viewlet.py", line 245, in __call__
  return ViewletManager.__call__(self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/content.py", line 59, in __call__
  return self.render(*args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 293, in render
  if not self.items:
File "/usr/lib/python2.7/dist-packages/zope/cachedescriptors/property.py", line 71, in __get__
  value = func(inst)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 212, in items
  result = [item for item in self.all_items
File "/usr/lib/python2.7/dist-packages/zope/cachedescriptors/property.py", line 71, in __get__
  value = func(inst)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 206, in all_items
  'content': viewlet(),
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/viewlet.py", line 77, in __call__
  return self.render(*args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 366, in render
  if not self.enabled:
File "/usr/lib/python2.7/dist-packages/schooltool/gradebook/browser/gradebook.py", line 1901, in enabled
  if self.gradebook is None:
File "/usr/lib/python2.7/dist-packages/zope/cachedescriptors/property.py", line 71, in __get__
  value = func(inst)
File "/usr/lib/python2.7/dist-packages/schooltool/gradebook/browser/gradebook.py", line 1889, in gradebook
  return interfaces.IGradebook(current_worksheet)

Changed in schooltool:
status: New → Confirmed
affects: schooltool → schooltool.gradebook
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

From the error I guess you can make it work yourself:
1) go to Deployed report sheets and unhide that sheet
2) go to the Gradebook and select a different sheet
3) hide that report sheet again

Will fix this bug of course.

Revision history for this message
Gediminas Paulauskas (menesis) wrote :

This happens when all sheets in a gradebook are hidden. Does not matter if they were report or regular sheets.

Also there is no way to go to the Gradebook and add a new sheet.

summary: - Internal Server Error on clicking on link to view a Section, whilst
- there is a Report Sheet deployed and "hidden"
+ Crash viewing a Section, when all sheets are hidden
Changed in schooltool.gradebook:
importance: Undecided → High
assignee: nobody → Alan Elkner (aelkner)
Changed in schooltool.gradebook:
importance: High → Critical
status: Confirmed → Triaged
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

I have committed a small fix that prevents this crash from happening, but Gradebook still acts strange when all sheets are hidden.

Alan Elkner (aelkner)
Changed in schooltool.gradebook:
status: Triaged → In Progress
Alan Elkner (aelkner)
Changed in schooltool.gradebook:
status: In Progress → Fix Committed
Revision history for this message
Douglas Cerna (replaceafill) wrote :

Alan, please fix that CSS change. It broke the gradebook layout.

Revision history for this message
Alan Elkner (aelkner) wrote :

Douglas,

Thanks for catching the css problem. I fixed it by simplifying the rule to apply only to elements of the empty_message class and only applying that class to the elements that needed it. I also moved the div outside the form and made the form itself be conditional on all_hdden, rather than the two divs contained therein.

Thanks,
Alan

Changed in schooltool.gradebook:
milestone: none → 2.0.2
Changed in schooltool.gradebook:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.