Browse Source

FIX : Add bookmark with search fields that are arrays (backport 4157263cb898f1847cfcfc22dee6007c01b13a4d)

Gauthier PC portable 024 2 years ago
parent
commit
723cdcea19
1 changed files with 7 additions and 1 deletions
  1. 7 1
      htdocs/bookmarks/bookmarks.lib.php

+ 7 - 1
htdocs/bookmarks/bookmarks.lib.php

@@ -65,7 +65,13 @@ function printDropdownBookmarksList()
 			if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var))
 				&& $val != ''
 				&& !array_key_exists($key, $url_param)) {
-				$url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
+				if (is_array($val)) {
+					foreach ($val as $tmpsubval) {
+						$url_param[] = http_build_query(array(dol_escape_htmltag($key).'[]' => dol_escape_htmltag($tmpsubval)));
+					}
+				} elseif ($val != '') {
+					$url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
+				}
 			}
 		}
 	}