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 15, 2025
1 parent eff30e4 commit 2ea31d0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .werks/17488.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[//]: # (werk v2)
# Fix filtering and sorting for custom host attribute view

key | value
---------- | ---
date | 2025-01-14T10:42:36+00:00
version | 2.5.0b1
class | fix
edition | cre
component | multisite
level | 1
compatible | yes

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 @@ -29,7 +29,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 make_confirm_delete_link, makeactionuri, makeuri_contextless
from cmk.gui.utils.urls import make_confirm_delete_link, makeactionuri, makeuri, makeuri_contextless
from cmk.gui.watolib.custom_attributes import (
CustomAttrSpec,
CustomHostAttrSpec,
Expand Down Expand Up @@ -494,10 +494,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 2ea31d0

Please sign in to comment.