Ticket #9346 (assigned defect)

Opened 8 years ago

Last modified 8 years ago

Browse by Language breaks if object with unrecognized language exists

Reported by: kef Owned by: ew2
Priority: high Milestone: Ticket Triage
Component: Browse Version: Live
Severity: major Keywords: ReportABug
Cc: System Area: Search/Browse
Primary Skill: Plone
Site URL: http://cnx.org/content/#language/
Suppress email to reporter: no

Description (last modified by kef) (diff)

Browse by language completely fails with the following error:

Problem retrieving data for cnx_refine_full: Service Unavailable

Change History

  Changed 8 years ago by kef

  • description modified (diff)
  • cc jccooper, ecw1, jenn added
  • suppressreporteremail unset
  • component changed from Unknown to Browse
  • priority changed from unprioritized to critical
  • owner changed from je2 to jccooper

  Changed 8 years ago by kef

We need to make sure that going through all the browses is in the Selenium tests (if that is possible) -- language is especially fragile.

follow-up: ↓ 4   Changed 8 years ago by jenn

  • skills changed from Unspecified to Plone

It is. Usually it's data problems that cause browse to die.

in reply to: ↑ 3   Changed 8 years ago by kef

Replying to jenn:

It is. Usually it's data problems that cause browse to die.

Good point. We have a bunch of new Vietnamese content so that might be affecting things. The error message occurs before you get to the selection of a particular language, though.

  Changed 8 years ago by jenn

  • owner changed from jccooper to jenn
  • status changed from new to working

There's a recently-published object with a language code of "undefined", which is messing up the listing of languages. Tracking it down now.

  Changed 8 years ago by jenn

  • owner changed from jenn to jccooper
  • priority changed from critical to high
  • status changed from working to assigned
  • severity changed from severe to major

Immediate panic averted by republishing m29517, which was the only bad object. Action items remaining: figure out how it happened (could it be a fluke of the VOCW import process?) and make the code robust to this sort of problem (much easier). Backing priority and severity off a notch.

In fact, the second one's so easy I just did it. Would someone code-review? This masks the problem, of course, should an invalid language manage to get set. The consequence would be that the wonky module wouldn't show up in language browse at all.

Index: RhaptosRepository/skins/rhaptos_repository/langCodesByEnglishSort.py
===================================================================
--- RhaptosRepository/skins/rhaptos_repository/langCodesByEnglishSort.py        (revision 28896)
+++ RhaptosRepository/skins/rhaptos_repository/langCodesByEnglishSort.py        (working copy)
@@ -10,7 +10,7 @@
 
 langLookup=context.content.langLookup()
 
-languageEnglishNames=[(langLookup[lc]['englishName'], lc) for lc in langData.keys()]
+languageEnglishNames=[(langLookup[lc]['englishName'], lc) for lc in langData.keys() if langLookup.has_key(lc)]
 languageEnglishNames.sort()
 
 languagesByEnglishName=[x[1] for x in languageEnglishNames]

  Changed 8 years ago by jccooper

That looks like a fine solution.

  Changed 8 years ago by jenn

  • cc jccooper, ecw1, jenn removed
  • owner changed from jccooper to ew2
  • summary changed from Browse by Language is BROKEN to Browse by Language breaks if object with unrecognized language exists
  • reporter changed from Katherine Fletcher <kef@…> to kef

Okay; next action is Ed's, to assign the investigation task. I'll just go ahead and put the patch on trunk.

  Changed 8 years ago by jenn

(In [28908]) Make another part of the language system robust to bad data. Refs #9346.

Note: See TracTickets for help on using tickets.