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-18 09:54:44 +08:00
parent fed66ad9e2
commit 53934bd0a9

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) {