Merge branch 'MDL-49231-master-fix' of https://github.com/FMCorz/moodle
This commit is contained in:
@@ -491,7 +491,6 @@ class mod_glossary_external extends external_api {
|
||||
self::fill_entry_details($record, $context);
|
||||
$entries[] = $record;
|
||||
}
|
||||
$records->close();
|
||||
|
||||
return array(
|
||||
'count' => $count,
|
||||
@@ -589,7 +588,6 @@ class mod_glossary_external extends external_api {
|
||||
self::fill_entry_details($record, $context);
|
||||
$entries[] = $record;
|
||||
}
|
||||
$records->close();
|
||||
|
||||
return array(
|
||||
'count' => $count,
|
||||
@@ -767,7 +765,6 @@ class mod_glossary_external extends external_api {
|
||||
}
|
||||
$entries[] = $record;
|
||||
}
|
||||
$records->close();
|
||||
|
||||
return array(
|
||||
'count' => $count,
|
||||
@@ -962,7 +959,6 @@ class mod_glossary_external extends external_api {
|
||||
self::fill_entry_details($record, $context);
|
||||
$entries[] = $record;
|
||||
}
|
||||
$records->close();
|
||||
|
||||
return array(
|
||||
'count' => $count,
|
||||
@@ -1066,7 +1062,6 @@ class mod_glossary_external extends external_api {
|
||||
self::fill_entry_details($record, $context);
|
||||
$entries[] = $record;
|
||||
}
|
||||
$records->close();
|
||||
|
||||
return array(
|
||||
'count' => $count,
|
||||
@@ -1168,7 +1163,6 @@ class mod_glossary_external extends external_api {
|
||||
self::fill_entry_details($record, $context);
|
||||
$entries[] = $record;
|
||||
}
|
||||
$records->close();
|
||||
|
||||
return array(
|
||||
'count' => $count,
|
||||
@@ -1249,7 +1243,6 @@ class mod_glossary_external extends external_api {
|
||||
self::fill_entry_details($record, $context);
|
||||
$entries[] = $record;
|
||||
}
|
||||
$records->close();
|
||||
|
||||
return array(
|
||||
'count' => $count,
|
||||
@@ -1336,7 +1329,6 @@ class mod_glossary_external extends external_api {
|
||||
self::fill_entry_details($record, $context);
|
||||
$entries[] = $record;
|
||||
}
|
||||
$records->close();
|
||||
|
||||
return array(
|
||||
'count' => $count,
|
||||
|
||||
+13
-7
@@ -3386,7 +3386,7 @@ function glossary_get_entries_by_letter($glossary, $context, $letter, $from, $li
|
||||
|
||||
// Fetching the entries.
|
||||
$count = $qb->count_records();
|
||||
$entries = $qb->get_recordset();
|
||||
$entries = $qb->get_records();
|
||||
|
||||
return array($entries, $count);
|
||||
}
|
||||
@@ -3429,7 +3429,7 @@ function glossary_get_entries_by_date($glossary, $context, $order, $sort, $from,
|
||||
|
||||
// Fetching the entries.
|
||||
$count = $qb->count_records();
|
||||
$entries = $qb->get_recordset();
|
||||
$entries = $qb->get_records();
|
||||
|
||||
return array($entries, $count);
|
||||
}
|
||||
@@ -3459,6 +3459,12 @@ function glossary_get_entries_by_category($glossary, $context, $categoryid, $fro
|
||||
|
||||
$qb->join_category($categoryid);
|
||||
$qb->join_user();
|
||||
|
||||
// The first field must be the relationship ID when viewing all categories.
|
||||
if ($categoryid === GLOSSARY_SHOW_ALL_CATEGORIES) {
|
||||
$qb->add_field('id', 'entries_categories', 'cid');
|
||||
}
|
||||
|
||||
$qb->add_field('*', 'entries');
|
||||
$qb->add_field('categoryid', 'entries_categories');
|
||||
$qb->add_user_fields();
|
||||
@@ -3478,7 +3484,7 @@ function glossary_get_entries_by_category($glossary, $context, $categoryid, $fro
|
||||
|
||||
// Fetching the entries.
|
||||
$count = $qb->count_records();
|
||||
$entries = $qb->get_recordset();
|
||||
$entries = $qb->get_records();
|
||||
|
||||
return array($entries, $count);
|
||||
}
|
||||
@@ -3526,7 +3532,7 @@ function glossary_get_entries_by_author($glossary, $context, $letter, $field, $s
|
||||
|
||||
// Fetching the entries.
|
||||
$count = $qb->count_records();
|
||||
$entries = $qb->get_recordset();
|
||||
$entries = $qb->get_records();
|
||||
|
||||
return array($entries, $count);
|
||||
}
|
||||
@@ -3574,7 +3580,7 @@ function glossary_get_entries_by_author_id($glossary, $context, $authorid, $orde
|
||||
|
||||
// Fetching the entries.
|
||||
$count = $qb->count_records();
|
||||
$entries = $qb->get_recordset();
|
||||
$entries = $qb->get_records();
|
||||
|
||||
return array($entries, $count);
|
||||
}
|
||||
@@ -3817,7 +3823,7 @@ function glossary_get_entries_by_term($glossary, $context, $term, $from, $limit,
|
||||
|
||||
// Fetching the entries.
|
||||
$count = $qb->count_records();
|
||||
$entries = $qb->get_recordset();
|
||||
$entries = $qb->get_records();
|
||||
|
||||
return array($entries, $count);
|
||||
}
|
||||
@@ -3861,7 +3867,7 @@ function glossary_get_entries_to_approve($glossary, $context, $letter, $order, $
|
||||
|
||||
// Fetching the entries.
|
||||
$count = $qb->count_records();
|
||||
$entries = $qb->get_recordset();
|
||||
$entries = $qb->get_records();
|
||||
|
||||
return array($entries, $count);
|
||||
}
|
||||
|
||||
@@ -773,7 +773,7 @@ class mod_glossary_external_testcase extends externallib_advanced_testcase {
|
||||
$e3 = $gg->create_content($g1, array('approved' => 1, 'concept' => 'Hero'));
|
||||
$e4 = $gg->create_content($g1, array('approved' => 0, 'concept' => 'Toulouse'));
|
||||
$e5 = $gg->create_content($g1, array('approved' => 1, 'definition' => 'Heroes', 'concept' => 'Abcd'));
|
||||
$e6 = $gg->create_content($g1, array('approved' => 0, 'definition' => 'When used for heroes'));
|
||||
$e6 = $gg->create_content($g1, array('approved' => 0, 'definition' => 'When used for Heroes'));
|
||||
$e7 = $gg->create_content($g1, array('approved' => 1, 'timecreated' => 1, 'timemodified' => time() + 3600,
|
||||
'concept' => 'Z'), array('Couscous'));
|
||||
$e8 = $gg->create_content($g1, array('approved' => 0), array('Heroes'));
|
||||
@@ -859,7 +859,7 @@ class mod_glossary_external_testcase extends externallib_advanced_testcase {
|
||||
$this->assertEquals($e7->id, $return['entries'][3]['id']);
|
||||
|
||||
// Advanced query string.
|
||||
$query = '+heroes -abcd';
|
||||
$query = '+Heroes -Abcd';
|
||||
$return = mod_glossary_external::get_entries_by_search($g1->id, $query, true, 'CONCEPT', 'ASC', 0, 20,
|
||||
array('includenotapproved' => true));
|
||||
$return = external_api::clean_returnvalue(mod_glossary_external::get_entries_by_search_returns(), $return);
|
||||
|
||||
Reference in New Issue
Block a user