Moodle

Global search does not search label because doc->contents is set to the label name [with patch]

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.4
  • Fix Version/s: None
  • Component/s: Global search
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

Index: label_document.php
===================================================================
RCS file: /cvsroot/moodle/moodle/search/documents/Attic/label_document.php,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 label_document.php
— label_document.php 27 Dec 2008 11:56:23 -0000 1.1.2.3
+++ label_document.php 27 Feb 2009 16:06:44 -0000
@@ -37,7 +37,7 @@
$doc->title = strip_tags($label['name']);
$doc->date = $label['timemodified'];
$doc->author = '';

  • $doc->contents = strip_tags($label['name']);
    + $doc->contents = strip_tags($label['content']);
    $doc->url = label_make_link($label['course']);

// module specific information; optional

Activity

Hide
Valery Fremaux added a comment -

Hi Urs,

I don't know if this was the exact cause : for labels name and content field have almost same content. Maybe it comes because "name" has a filtered content, which strips all HTML tags, and might glue some words in the text so significant tokens are broken...

givin 'content' to the indexer might submit HTML content that is not expected in the indexing hasher...

The most problematic issue comes from the core label code itself that might be reviewed to not filter the name field when recording the label, and thus letting richer HTML sequences to be let unchanged there...

I think the mest compromise might be putting here a filtered string but replacing HTML tags by spaces, not by an empty string, so that indexed wordset keeps correct.

Cheers.

Show
Valery Fremaux added a comment - Hi Urs, I don't know if this was the exact cause : for labels name and content field have almost same content. Maybe it comes because "name" has a filtered content, which strips all HTML tags, and might glue some words in the text so significant tokens are broken... givin 'content' to the indexer might submit HTML content that is not expected in the indexing hasher... The most problematic issue comes from the core label code itself that might be reviewed to not filter the name field when recording the label, and thus letting richer HTML sequences to be let unchanged there... I think the mest compromise might be putting here a filtered string but replacing HTML tags by spaces, not by an empty string, so that indexed wordset keeps correct. Cheers.
Hide
Urs Hunkler added a comment - - edited

Valery, you wrote "for labels name and content field have almost same content". That's not right. The name field is set to "varchar(255)" and the content field is a text field. The name field holds a small part of the content.

We noticed the bug because some of the first words in a label where found but later words not.

Can't you handle the label content similar to the glossary entry or a forum message? Both can contain HTML.

The actual situation we need to consider a bug because user expectations are not met and people need to spend time to find out why some words in a label are found and some not.

Can you please correct the label handling?

Thank you very much.

Show
Urs Hunkler added a comment - - edited Valery, you wrote "for labels name and content field have almost same content". That's not right. The name field is set to "varchar(255)" and the content field is a text field. The name field holds a small part of the content. We noticed the bug because some of the first words in a label where found but later words not. Can't you handle the label content similar to the glossary entry or a forum message? Both can contain HTML. The actual situation we need to consider a bug because user expectations are not met and people need to spend time to find out why some words in a label are found and some not. Can you please correct the label handling? Thank you very much.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (5)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: