Merge pull request #13885 from atm-maxime/fix_top_menu_search
Fix top menu search method must be GET
This commit is contained in:
commit
30c167c6f4
@ -2002,7 +2002,7 @@ function top_menu_search()
|
|||||||
|
|
||||||
$defaultAction = '';
|
$defaultAction = '';
|
||||||
$buttonList = '<div class="dropdown-global-search-button-list" >';
|
$buttonList = '<div class="dropdown-global-search-button-list" >';
|
||||||
// Menu with all bookmarks
|
// Menu with all searchable items
|
||||||
foreach ($arrayresult as $keyItem => $item)
|
foreach ($arrayresult as $keyItem => $item)
|
||||||
{
|
{
|
||||||
if (empty($defaultAction)) {
|
if (empty($defaultAction)) {
|
||||||
@ -2017,9 +2017,7 @@ function top_menu_search()
|
|||||||
|
|
||||||
$searchInput = '<input name="sall" id="top-global-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Search').'" autocomplete="off" >';
|
$searchInput = '<input name="sall" id="top-global-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Search').'" autocomplete="off" >';
|
||||||
|
|
||||||
|
$dropDownHtml = '<form id="top-menu-action-search" name="actionsearch" method="GET" action="'.$defaultAction.'" >';
|
||||||
$dropDownHtml = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
|
|
||||||
$dropDownHtml .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action="'.$defaultAction.'" >';
|
|
||||||
|
|
||||||
$dropDownHtml .= '
|
$dropDownHtml .= '
|
||||||
<!-- search input -->
|
<!-- search input -->
|
||||||
@ -2068,8 +2066,8 @@ function top_menu_search()
|
|||||||
|
|
||||||
// submit form action
|
// submit form action
|
||||||
$(".dropdown-global-search-button-list .global-search-item").on("click", function(event) {
|
$(".dropdown-global-search-button-list .global-search-item").on("click", function(event) {
|
||||||
$("#top-menu-action-bookmark").attr("action", $(this).data("target"));
|
$("#top-menu-action-search").attr("action", $(this).data("target"));
|
||||||
$("#top-menu-action-bookmark").submit();
|
$("#top-menu-action-search").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
// close drop down
|
// close drop down
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user