MDL-53538 mod_data: Show no records message instead of error.

When there are no records in the database module and a user
does an advanced search. Show a message that there are no entries
in the database.
This commit is contained in:
Adrian Greeve
2016-03-22 14:27:09 +08:00
parent 225913650f
commit f186db050c
+5
View File
@@ -3654,6 +3654,11 @@ function data_get_all_recordids($dataid, $selectdata = '', $params = null) {
* @return array $recordids An array of record ids.
*/
function data_get_advance_search_ids($recordids, $searcharray, $dataid) {
// Check to see if we have any record IDs.
if (empty($recordids)) {
// Send back an empty search.
return array();
}
$searchcriteria = array_keys($searcharray);
// Loop through and reduce the IDs one search criteria at a time.
foreach ($searchcriteria as $key) {