global search MDL-24625

- maintenance fixes to (regressions in) search documents.
- some table references to old modname_comments tables changed to {comments} table.
This commit is contained in:
Aparup Banerjee
2010-10-27 03:50:59 +00:00
parent 38e22fe9ed
commit dbb4a053d3
8 changed files with 12 additions and 12 deletions
+3 -3
View File
@@ -90,7 +90,7 @@
$valuesArray = $db_names_function();
if ($valuesArray){
foreach($valuesArray as $values){
$where = (isset($values[5])) ? 'AND ('.$values[5].')' : '';
$where = (isset($values[5]) and $values[5]!='') ? 'AND ('.$values[5].')' : '';
$itemtypes = ($values[4] != '*' && $values[4] != 'any') ? " AND itemtype = '{$values[4]}' " : '' ;
//select records in MODULE table, but not in SEARCH_DATABASE_TABLE
@@ -108,14 +108,14 @@
$docIds = $DB->get_records_sql_menu($query, array($mod->name));
if (!empty($docIds)){
list($usql, $params) = $DB->get_in_or_equal(array_keys('$docIds'), SQL_PARAMS_QM, 'param0000', false); // negative IN
list($usql, $params) = $DB->get_in_or_equal(array_keys($docIds), SQL_PARAMS_QM, 'param0000', false); // negative IN
$query = "
SELECT id,
$values[0] as docid
FROM
{{$values[1]}}
WHERE
id $uslq AND
id $usql AND
$values[2] > $indexdate
$where
";
+1 -1
View File
@@ -284,7 +284,7 @@ function assignment_delete($info, $itemtype) {
* // TODO chat indexable records are virtual. Should proceed in a special way
*/
function assignment_db_names() {
//[primary id], [table name], [time created field name], [time modified field name]
//[primary id], [table name], [time created field name], [time modified field name], [docsubtype], [additional where conditions for sql]]
return array(
array('id', 'assignment', 'timemodified', 'timemodified', 'description'),
array('id', 'assignment_submissions', 'timecreated', 'timemodified', 'submitted')
+1 -1
View File
@@ -246,7 +246,7 @@ function chat_delete($info, $itemtype) {
* // TODO chat indexable records are virtual. Should proceed in a special way
*/
function chat_db_names() {
//[primary id], [table name], [time created field name], [time modified field name]
//[primary id], [table name], [time created field name], [time modified field name], [docsubtype], [additional where conditions for sql]
return null;
}
+2 -2
View File
@@ -318,10 +318,10 @@ function data_delete($info, $itemtype) {
*
*/
function data_db_names() {
//[primary id], [table name], [time created field name], [time modified field name]
//[primary id], [table name], [time created field name], [time modified field name], [docsubtype], [additional where conditions for sql]
return array(
array('id', 'data_records', 'timecreated', 'timemodified', 'record'),
array('id', 'data_comments', 'created', 'modified', 'comment')
array('id', 'comments', 'timecreated', 'timecreated', 'comment')
);
}
+1 -1
View File
@@ -165,7 +165,7 @@ function forum_delete($info, $itemtype) {
*
*/
function forum_db_names() {
//[primary id], [table name], [time created field name], [time modified field name]
//[primary id], [table name], [time created field name], [time modified field name], [docsubtype], [additional where conditions for sql]
return array(
array('id', 'forum_posts', 'created', 'modified', 'head', 'parent = 0'),
array('id', 'forum_posts', 'created', 'modified', 'post', 'parent != 0')
+1 -1
View File
@@ -227,7 +227,7 @@ function glossary_db_names() {
//[primary id], [table name], [time created field name], [time modified field name]
return array(
array('id', 'glossary_entries', 'timecreated', 'timemodified', 'standard'),
array('id', 'glossary_comments', 'timemodified', 'timemodified', 'comment')
array('id', 'comments', 'timecreated', 'timecreated', 'comment')
);
}
+1 -1
View File
@@ -299,7 +299,7 @@ function resource_delete($info, $itemtype) {
*/
function resource_db_names() {
//[primary id], [table name], [time created field name], [time modified field name], [additional where conditions for sql]
return array(array('id', 'resource', 'timemodified', 'timemodified', 'any', " (alltext != '' AND alltext != ' ' AND alltext != ' ' AND TYPE != 'file') OR TYPE = 'file' "));
return array(array('id', 'resource_old', 'timemodified', 'timemodified', 'any', " (alltext != '' AND alltext != ' ' AND alltext != ' ' AND TYPE != 'file') OR TYPE = 'file' "));
}
/**
+2 -2
View File
@@ -240,8 +240,8 @@ function wiki_delete($info, $itemtype) {
//returns the var names needed to build a sql query for addition/deletions
function wiki_db_names() {
//[primary id], [table name], [time created field name], [time modified field name]
return array(array('id', 'wiki_pages', 'created', 'lastmodified', 'standard'));
//[primary id], [table name], [time created field name], [time modified field name], [docsubtype], [additional where conditions for sql]
return array(array('id', 'wiki_pages', 'timecreated', 'lastmodified', 'standard'));
}
/**