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:
+3
-3
@@ -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
|
||||
";
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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' "));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user