MissingInputError when trying to Edit Goal

Bug #859714 reported by Gediminas Paulauskas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool Intervention
Fix Released
Critical
Gediminas Paulauskas

Bug Description

When I click Edit Goal, New Message, or New Goal button (green plus), logged in as Administrator, I get an error.

MissingInputError

A server error occurred.

This is not even an exception page, but a blank page with the two lines of text above.

When logged in as a teacher, the same views work fine.

Exception from the log:

2011-09-26 18:08:39,600 Exception while rendering view on exception
Traceback (most recent call last):
  File "/home/menesis/.buildout/eggs/zope.app.publication-3.13.2-py2.6.egg/zope/app/publication/zopepublication.py", line 379, in handleException
    body = mapply(view, (), request)
  File "/home/menesis/.buildout/eggs/zope.publisher-3.12.6-py2.6.egg/zope/publisher/publish.py", line 107, in mapply
    return debug_call(obj, args)
  File "/home/menesis/.buildout/eggs/zope.publisher-3.12.6-py2.6.egg/zope/publisher/publish.py", line 113, in debug_call
    return obj(*args)
  File "/home/menesis/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/simpleviewclass.py", line 44, in __call__
    return self.index(*args, **kw)
  File "/home/menesis/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
    return self.im_func(im_self, *args, **kw)
  File "/home/menesis/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
    sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  File "/home/menesis/.buildout/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations)()
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 888, in do_useMacro
    self.interpret(macro)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
    return self.no_tag(start, program)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
    self.interpret(program)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 376, in do_startEndTag
    self.do_startTag(stuff, self.endsep, self.endlen)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 405, in do_startTag
    rendered = attrAction(self, item)
  File "/home/menesis/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 482, in attrAction_tal
    evalue = self.engine.evaluateText(item[3])
  File "/home/menesis/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 704, in evaluateText
    text = self.evaluate(expr)
  File "/home/menesis/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
    return expression(self)
  File "/home/menesis/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 217, in __call__
    return self._eval(econtext)
  File "/home/menesis/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 194, in _eval
    ob = self._subexprs[-1](econtext)
  File "/home/menesis/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 124, in _eval
    ob = self._traverser(ob, element, econtext)
  File "/home/menesis/.buildout/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/engine.py", line 66, in __call__
    request=request)
  File "/home/menesis/.buildout/eggs/zope.traversing-3.13.2-py2.6.egg/zope/traversing/adapters.py", line 126, in traversePathElement
    return namespaceLookup(ns, nm, obj, request)
  File "/home/menesis/.buildout/eggs/zope.traversing-3.13.2-py2.6.egg/zope/traversing/namespace.py", line 112, in namespaceLookup
    return traverser.traverse(name, ())
  File "/home/menesis/.buildout/eggs/zope.traversing-3.13.2-py2.6.egg/zope/traversing/namespace.py", line 338, in traverse
    return getResource(self.context, name, self.request)
  File "/home/menesis/.buildout/eggs/zope.traversing-3.13.2-py2.6.egg/zope/traversing/namespace.py", line 160, in getResource
    raise LocationError(site, name)
LocationError: (MissingInputError('', '', None), 'layout.css')

Does not say anything to me.

Changed in schooltool.intervention:
assignee: nobody → Alan Elkner (aelkner)
milestone: none → 1.9.1
Alan Elkner (aelkner)
Changed in schooltool.intervention:
importance: Undecided → Critical
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

The offending code is in intervention/browser/widgets.py, line 219:

    def getInputValue(self):
        """See zope.formlib.interfaces.IInputWidget"""
        contacts = self.getRequestValue()
        if not contacts and self.enabled:
            self._error = MissingInputError.__doc__
            raise MissingInputError('', '')
        return contacts

    def hasValidInput(self):
        """See zope.formlib.interfaces.IInputWidget"""
        return bool(self.getInputValue())

So this happens when the email server is enabled, but there are no persons responsible selected. Maybe I had old data that could be made incorrect like this, or evolution did not do something needed.

But this exception happens not when one tries to save with not all required fields filled, but on showing the page.

The raise MissingInputError('', '') line is strange, but anyway this exception is not caught correctly and an old-style empty page is being displayed, but this fails again.

But this code works in the old skin intervention. Only not in flourish.

The problem is that extract() gets an exception and does not know what to do with it. Changing to

    def extract(self):
        return self.getRequestValue()

Avoids this exception.

Revision history for this message
Justas Sadzevičius (justas.sadzevicius) wrote :

Wow. Nice catch menesis.

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

I have committed this workaround to avoid a crash on load

http://bazaar.launchpad.net/~schooltool-owners/schooltool.intervention/flourish/revision/314

but the widget implementation is weird. If there are any errors, selected persons are what was before, does not remember changes.

Also sometimes there is a person with an empty brackets, e.g. Herbert Dawson () . Not sure what they are.

Revision history for this message
Tom Hoffman (tom-hoffman) wrote :

Yes, I remember talking to Alan about getting rid of the person as function call thing, but perhaps we dropped the ball on completing it.

Changed in schooltool.intervention:
status: New → Fix Committed
assignee: Alan Elkner (aelkner) → Gediminas Paulauskas (menesis)
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

The crash is fixed, can open a new bug for the widget not remembering selection on errors.

Changed in schooltool.intervention:
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.