searching bibligraphy adds <em></em> around result

princeofwales - October 6, 2009 - 15:26
Project:Bibliography Module
Version:6.x-1.7
Component:User interface
Category:bug report
Priority:normal
Assigned:Frank Steiner
Status:closed
Description

See http://ages.ca/documents

Search for document using biblio search (not drupal site search)

result title has em tags around it, i.e.

Search results for em search term /em [Reset Search]

#1

Frank Steiner - October 7, 2009 - 10:40
Assigned to:Anonymous» Frank Steiner
Status:active» needs review

Tags were added before check_plain.

Please try the attached patch.

AttachmentSize
biblio_style_search_result.patch 995 bytes

#2

princeofwales - October 7, 2009 - 11:31

Will this result in overlapping tags?

  $content .= '<div class="biblio-current-filters"><b>'.t('Search results for <em>').'</b>';

#3

rjerome - October 7, 2009 - 12:58

Yes it will.

I would recommend (and have already implemented in the code)...

### Eclipse Workspace Patch 1.0
#P biblio-dev
Index: biblio.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/biblio/biblio.pages.inc,v
retrieving revision 1.1.2.97
diff -u -r1.1.2.97 biblio.pages.inc
--- biblio.pages.inc 30 Sep 2009 15:48:25 -0000 1.1.2.97
+++ biblio.pages.inc 7 Oct 2009 12:57:27 -0000
@@ -588,7 +588,7 @@
       array_shift($args);
       $value = db_escape_string($args[0]);
       if ($type == 'search') {
-        $search_content = '<em>'. array_shift($args).'</em>';
+        $search_content = array_shift($args);
         continue;
       }
       if ($type == 'term_id') {
@@ -634,7 +634,7 @@
     }
     if ($search_content) {
       $content .= '<div class="biblio-current-filters"><b>'.t('Search results for ').'</b>';
-      $content .= check_plain($search_content);
+      $content .= '<em>'. check_plain($search_content) .'</em>';
       if ($filtercontent) {
         $content .= '<br><b>'.t('Filters').': </b>';
       }

#4

princeofwales - October 7, 2009 - 19:41

Thanks for both the patches...let me see where the issue is in the code.

Does that mean that the easiest thing to do is to download the module, extract the one file, and upload that to my site(s)?

#5

rjerome - October 7, 2009 - 20:26

You could just edit biblio.pages.inc and change line 591 to look like this...

$search_content = array_shift($args);

and change line 637 to look like this...

      $content .= '<em>'. check_plain($search_content) .'</em>';

Ron.

#6

princeofwales - October 8, 2009 - 00:22

poifect! Many thanks!

#7

rjerome - October 8, 2009 - 13:08
Status:needs review» fixed

#8

rjerome - October 8, 2009 - 20:42

#9

System Message - October 22, 2009 - 20:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.