MDL-62707 search: account for no matching courses when listing areas.
When limiting the list of courses during retrieval of the search areas the user can access, make sure we have some contexts before looking for blocks.
This commit is contained in:
@@ -823,8 +823,8 @@ class manager {
|
||||
}
|
||||
}
|
||||
|
||||
// Add all supported block contexts, in a single query for performance.
|
||||
if (!empty($areasbylevel[CONTEXT_BLOCK])) {
|
||||
// Add all supported block contexts for course contexts that user can access, in a single query for performance.
|
||||
if (!empty($areasbylevel[CONTEXT_BLOCK]) && !empty($coursecontextids)) {
|
||||
// Get list of all block types we care about.
|
||||
$blocklist = [];
|
||||
foreach ($areasbylevel[CONTEXT_BLOCK] as $areaid => $searchclass) {
|
||||
|
||||
Reference in New Issue
Block a user