Skip to content

Commit

Permalink
17488 FIX custom host attributes setup keep http vars for table sort …
Browse files Browse the repository at this point in the history
…and search

SUP-18972

Change-Id: Ic6447e908a405ea9eb22f342e2dfb068c34cd894
  • Loading branch information
otAAAh committed Jan 16, 2025
1 parent 19a0003 commit 797f7a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .werks/17488
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Title: Fix filtering and sorting for custom host attribute view
Class: fix
Compatible: compat
Component: multisite
Date: 1736851356
Edition: cre
Level: 1
Version: 2.2.0p38

Sorting by clicking the table column header did not sort entries in the Custom Host Attribute view, and applied filters were reset.

Now filtering and sorting functions work as expected.
8 changes: 5 additions & 3 deletions cmk/gui/wato/pages/custom_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from cmk.gui.table import table_element
from cmk.gui.type_defs import ActionResult, Choices, PermissionName
from cmk.gui.utils.transaction_manager import transactions
from cmk.gui.utils.urls import makeactionuri, makeuri_contextless
from cmk.gui.utils.urls import makeactionuri, makeuri, makeuri_contextless
from cmk.gui.watolib.custom_attributes import (
load_custom_attrs_from_mk_file,
save_custom_attrs_to_mk_file,
Expand Down Expand Up @@ -463,10 +463,12 @@ def _page_menu_entries_related(self) -> Iterable[PageMenuEntry]:

def action(self) -> ActionResult:
if not transactions.check_transaction():
return redirect(self.mode_url())
request.del_var("_transid")
return redirect(makeuri(request=request, addvars=list(request.itervars())))

if not request.var("_delete"):
return redirect(self.mode_url())
request.del_var("_transid")
return redirect(makeuri(request=request, addvars=list(request.itervars())))

delname = request.get_ascii_input_mandatory("_delete")
for index, attr in enumerate(self._attrs):
Expand Down

0 comments on commit 797f7a9

Please sign in to comment.