Ticket #802 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

move search script into Portal Object

Reported by: tziade Owned by: trac
Priority: P2 Milestone: CPS 3.3.7
Component: CPSDefault Version: 3.3.4
Severity: normal Keywords:
Cc:

Description

This is more likely to be a proposal.

I've run into a problem on a portal: sometimes the search results where returning empty results as they should not.

this is due to the search script that hides all error by doing a dry try-except when it calls the catalog.

try:
    brains = catalog(**query)
except: # XXX catch only ParseError
    LOG('CPSDefault.search', INFO, 'got an exception during search %s' % query)
    return []

I had an hidden unicode error there. The only reason I see about doing this dry except, is because the protected context won't let import Exception class.

I propose to move the search script into a method of the portal object and to name any exception.

I'll wait a bit before doing it, to see if people have a better proposal.

Change History

comment:1 Changed 14 years ago by fguillaume

It's simpler to just allow ParseError to be imported from restricted code, using AllowModule/AllowClass, and use it in the existing script.

comment:2 Changed 14 years ago by fguillaume

  • Priority changed from P1 to P2
  • Version changed from TRUNK to 3.3.4

comment:3 Changed 14 years ago by fguillaume

  • Milestone changed from CPS 3.3.5 to CPS 3.3.6

comment:4 Changed 14 years ago by fguillaume

  • Milestone changed from CPS 3.3.6 to CPS 3.4.0

comment:5 Changed 14 years ago by ogrisel

  • Status changed from new to closed
  • Resolution set to fixed

fixed in [28745] and [28746] by allowing the import of parsing exceptions

Note: See TracTickets for help on using tickets.