diff --git a/blocks/community/communitycourse.php b/blocks/community/communitycourse.php index fe21d76b15f..a7224e5c52e 100644 --- a/blocks/community/communitycourse.php +++ b/blocks/community/communitycourse.php @@ -142,7 +142,7 @@ $fromformdata['subject'] = optional_param('subject', 'all', PARAM_ALPHANUMEXT); $fromformdata['audience'] = optional_param('audience', 'all', PARAM_ALPHANUMEXT); $fromformdata['language'] = optional_param('language', current_language(), PARAM_ALPHANUMEXT); $fromformdata['educationallevel'] = optional_param('educationallevel', 'all', PARAM_ALPHANUMEXT); -$fromformdata['downloadable'] = optional_param('downloadable', 1, PARAM_ALPHANUM); +$fromformdata['downloadable'] = optional_param('downloadable', $usercandownload, PARAM_ALPHANUM); $fromformdata['orderby'] = optional_param('orderby', 'newest', PARAM_ALPHA); $fromformdata['huburl'] = optional_param('huburl', HUB_MOODLEORGHUBURL, PARAM_URL); $fromformdata['search'] = $search; diff --git a/blocks/community/forms.php b/blocks/community/forms.php index cb8d7d3e188..552130ccf3d 100644 --- a/blocks/community/forms.php +++ b/blocks/community/forms.php @@ -213,6 +213,7 @@ class community_hub_search_form extends moodleform { } else { $mform->addElement('hidden', 'downloadable', 0); } + $mform->setType('downloadable', PARAM_INT); $options = array(); $options['all'] = get_string('any');