diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php index 7145bc9dd2..602b10b152 100755 --- a/main/exercise/exercise.class.php +++ b/main/exercise/exercise.class.php @@ -8417,7 +8417,11 @@ class Exercise $categoryCondition = ''; $categoryId = (int) $categoryId; if (api_get_configuration_value('allow_exercise_categories')) { - $categoryCondition = " AND exercise_category_id = $categoryId "; + if (!empty($categoryId)) { + $categoryCondition = " AND exercise_category_id = $categoryId "; + } else { + $categoryCondition = " AND exercise_category_id IS NULL "; + } } $keywordCondition = '';