diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php
index a7fdcd147c4..5d68dff0bc5 100644
--- a/htdocs/webportal/class/html.formwebportal.class.php
+++ b/htdocs/webportal/class/html.formwebportal.class.php
@@ -910,7 +910,11 @@ class FormWebPortal extends Form
}
} else {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
- $data = $this->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
+ $categorytype = $InfoFieldList[5];
+ if (is_numeric($categorytype)) {
+ $categorytype = Categorie::$MAP_ID_TO_CODE[$categorytype]; // For backward compatibility
+ }
+ $data = $this->select_all_categories($categorytype, '', 'parent', 64, $InfoFieldList[6], 1, 1);
$out .= '';
foreach ($data as $data_key => $data_value) {
$out .= '