Hi Tibor,

Fixed in CVS.  Thanks for the patch (note that I modified it, because
you should not really replace c and c_name, only c_printable)
[...]

Great!  Your fix was of course better.  Testing it, I found we forgot
another snippet, when an error message is displayed.  I've also added a
cosmetic <em></em> in the list of collection names, because I feel it
is easier to read, but you decide.

Thanks again,

Ferran
Index: cds-invenio-0.91.0.20061116/modules/websearch/lib/search_engine.py
===================================================================
--- cds-invenio-0.91.0.20061116.orig/modules/websearch/lib/search_engine.py	2006-12-01 10:52:10.000000000 +0100
+++ cds-invenio-0.91.0.20061116/modules/websearch/lib/search_engine.py	2006-12-01 10:59:55.000000000 +0100
@@ -1562,11 +1562,13 @@
         t1 = os.times()[4]
     results = {}
     results_nbhits = 0
+    colls_printable = []
     for coll in colls:
         results[coll] = HitSet()
         results[coll]._set = Numeric.bitwise_and(hitset_in_any_collection._set, get_collection_reclist(coll)._set)
         results[coll].calculate_nbhits()
         results_nbhits += results[coll]._nbhits
+        colls_printable.append(get_coll_i18nname(coll, ln))
     if results_nbhits == 0:
         # no hits found, try to search in Home:
         results_in_Home = HitSet()
@@ -1577,7 +1579,7 @@
             if of.startswith("h"):
                 url = websearch_templates.build_search_url(req.argd, cc=cdsname, c=[])
                 print_warning(req, _("No match found in collection %(x_collection)s. Other public collections gave %(x_url_open)s%(x_nb_hits)d hits%(x_url_close)s.") %\
-                              {'x_collection': string.join(colls, ','), 
+                              {'x_collection': '<em>' + string.join(colls_printable, ',') + '</em>',
                                'x_url_open': '<a class="nearestterms" href="%s">' % (url),
                                'x_nb_hits': results_in_Home._nbhits,
                                'x_url_close': '</a>'})

Reply via email to