diff --git a/search.php b/search.php index 8854cdb12f..22bda6f61e 100644 --- a/search.php +++ b/search.php @@ -136,12 +136,13 @@ $(document).ready(function() { contentType: "application/x-www-form-urlencoded", type: "GET", url: "'.api_get_path(WEB_AJAX_PATH).'extra_field.ajax.php?a=search_options_from_tags&type=session&from=extra_domaine&search="+themeDefault+"&options="+domainListToString, - success: function(data) { - + success: function(data) { var selectToString = ""; + selectToString += ""; jQuery.each(JSON.parse(data), function(i, item) { - selectToString += ""; - jQuery.each(item.children, function(j, data) { + selectToString += ""; + // Add empty value + jQuery.each(item.children, function(j, data) { if (data.text != "") { selectToString += "" } @@ -150,10 +151,12 @@ $(document).ready(function() { }); for (i = 0; i <= 5; i++) { - var themeId = "#"+themeDefault+"_"+i; + var themeId = "#"+themeDefault+"_"+i; + var beforeValue = $(themeId).find(":selected").val() $(themeId).find("option").remove().end(); $(themeId).empty(); - $(themeId).html(selectToString); + $(themeId).html(selectToString); + $(themeId).val(beforeValue); $(themeId).selectpicker("refresh"); } } diff --git a/user_portal.php b/user_portal.php index 22b2c4b73c..47bd3b65d6 100755 --- a/user_portal.php +++ b/user_portal.php @@ -248,7 +248,9 @@ if (api_is_student()) { 'diagnosis_completed' ); - if ($diagnosisComplete === false) { + if ($diagnosisComplete === false || + is_array($diagnosisComplete) && empty($diagnosisComplete['value']) + ) { $url = api_get_path(WEB_PATH).'search.php'; $link = Display::url($url, $url); Display::addFlash(