Blank Search Field Yields General Error

Bug #784226 reported by Nat Katin-Borland
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KARL3
Fix Released
High
Chris Rossi

Bug Description

If you don't have search term in the advanced search box and hit return or press the search icon, then you get a general error. There should be a more graceful error - either an error saying please add more text (like we do LiveSearch) or just a blank results page. It's actually pretty easy to generate this error now, especially if you're searching for multiple terms in row.

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
    <title>General Error</title>
    <link href="https://karlstaging.gocept.com/branch2/osf/static/images/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
    <link href="https://karlstaging.gocept.com/branch2/osf/static/images/favicon.ico" rel="icon" type="image/vnd.microsoft.icon" />
    <link href="https://karlstaging.gocept.com/branch2/osf/static/themedstyles.css" rel="stylesheet" type="text/css" />
    <link href="https://karlstaging.gocept.com/branch2/osf/static/custom.css" rel="stylesheet" type="text/css" />

  </head>
  <body id="login-wrapper">
    <img src="https://karlstaging.gocept.com/branch2/osf/static/images/login_gradient.gif" id="login-gradient" />
    <div id="outer">
      <div id="inner">
        <h1 class="kscreentitle" style="margin-top: 50px">
          <span></span>
        </h1>
 <h2 style="margin-top: 20px; text-align: center">General Error</h2>
        <p align="center">
KARL encountered an application error. Please click
the link below to return to the KARL home page.
</p>
 <p align="center">
   Return to the <a href="https://karlstaging.gocept.com/branch2/osf/">home page</a>.
 </p>

   <!--
       Traceback (most recent call last):
  File "/srv/osfkarltest/staging/branch2/src/karl/karl/errorpage.py", line 51, in __call__
    resp = req.get_response(self.app)
  File "/srv/osfkarltest/staging/branch2/eggs/WebOb-0.9.8.0_osi1-py2.6.egg/webob/request.py", line 920, in get_response
    application, catch_exc_info=False)
  File "/srv/osfkarltest/staging/branch2/eggs/WebOb-0.9.8.0_osi1-py2.6.egg/webob/request.py", line 888, in call_application
    app_iter = application(self.environ, start_response)
  File "/srv/osfkarltest/staging/branch2/src/karl/karl/errorlog.py", line 16, in middleware
    return app(environ, start_response)
  File "/srv/osfkarltest/staging/branch2/eggs/repoze.retry-0.9.4-py2.6.egg/repoze/retry/__init__.py", line 88, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/srv/osfkarltest/staging/branch2/eggs/repoze.zodbconn-0.11-py2.6.egg/repoze/zodbconn/connector.py", line 21, in __call__
    result = self.next_app(environ, start_response)
  File "/srv/osfkarltest/staging/branch2/eggs/repoze.tm2-1.0a5-py2.6.egg/repoze/tm/__init__.py", line 23, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/srv/osfkarltest/staging/branch2/eggs/repoze.who-1.0.15-py2.6.egg/repoze/who/middleware.py", line 107, in __call__
    app_iter = app(environ, wrapper.wrap_start_response)
  File "/srv/osfkarltest/staging/branch2/eggs/repoze.bfg-1.2-py2.6.egg/repoze/bfg/router.py", line 130, in __call__
    response = view_callable(context, request)
  File "/srv/osfkarltest/staging/branch2/eggs/repoze.bfg-1.2-py2.6.egg/repoze/bfg/configuration.py", line 1753, in _secured_view
    return view(context, request)
  File "/srv/osfkarltest/staging/branch2/eggs/repoze.bfg-1.2-py2.6.egg/repoze/bfg/configuration.py", line 1708, in _rendered_view
    renderer_name)
  File "/srv/osfkarltest/staging/branch2/eggs/repoze.bfg-1.2-py2.6.egg/repoze/bfg/configuration.py", line 1562, in rendered_response
    'context':context, 'request':request})
  File "/srv/osfkarltest/staging/branch2/eggs/repoze.bfg-1.2-py2.6.egg/repoze/bfg/chameleon_zpt.py", line 46, in __call__
    result = self.template(**system)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/core/template.py", line 83, in __call__
    return self.render(**kwargs)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/core/template.py", line 335, in render
    return super(TemplateFile, self).render(**kwargs)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/zpt/template.py", line 18, in render
    return super(PageTemplate, self).render(**kwargs)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/core/template.py", line 188, in render
    return self.cook_and_render(kwargs, utils.emptydict, None, True)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/core/template.py", line 315, in cook_and_render
    args, slots, macro, global_scope)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/core/template.py", line 180, in cook_and_render
    return func(econtext, rcontext)
  File "/srv/osfkarltest/staging/branch2/src/karl/karl/views/templates/searchresults.pt.py", line 852, in render
    _metal.render(_tmp, _out=_out, _write=_write, _domain=_domain, econtext=econtext)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/core/template.py", line 379, in render
    return self.render(name, slots=slots, parameters=kwargs)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/zpt/template.py", line 23, in render_macro
    macro, global_scope=global_scope, slots=slots, parameters=parameters)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/core/template.py", line 198, in render_macro
    return self.cook_and_render(parameters, slots, macro, global_scope)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/core/template.py", line 315, in cook_and_render
    args, slots, macro, global_scope)
  File "/srv/osfkarltest/staging/branch2/eggs/Chameleon-1.1.1-py2.6.egg/chameleon/core/template.py", line 180, in cook_and_render
    return func(econtext, rcontext)
  File "/srv/osfkarltest/staging/branch2/src/karl/karl/views/templates/generic_layout.pt.py", line 493, in render
    _tmp(econtext)
  File "/srv/osfkarltest/staging/branch2/src/karl/karl/views/templates/searchresults.pt.py", line 161, in _callback_content
    _tmp1 = econtext['batch_info']['total']
KeyError: 'total'

     -->

      </div>

    </div>

  </body>
</html>

Tags: r3.59
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Look, a "High" priority!

Good catch Nat. This one is indeed a blocker.

Changed in karl3:
assignee: nobody → Chris Rossi (chris-archimedeanco)
importance: Undecided → High
milestone: none → m56
Changed in karl3:
status: New → Fix Committed
Revision history for this message
JimPGlenn (jpglenn09) wrote :

fixed

Changed in karl3:
status: Fix Committed → Fix Released
JimPGlenn (jpglenn09)
tags: added: r3.59
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.