iPSK-Manager icon indicating copy to clipboard operation
iPSK-Manager copied to clipboard

Filters for the Managed iPSK EndPoints Page are not Filtering Correctly

Open brdlyp opened this issue 3 months ago • 10 comments

Describe the bug There appears to be an issue with the filter fields on the 'Manage iPSK Endpoints' page in the admin portal. Basically, only the 'Filter MAC Address' field works for searching endpoint MAC addresses. None of the other fields seem to work for there purpose, but you can search with the MAC address in the other fields and that still works.

To Reproduce Steps to reproduce the behaviour:

  1. Select Managed iPSK Endpoints
  2. Grab a MAC address for an endpoint that already exists in your iPSK Manager.
  3. Search with that MAC address in the Filter MAC Address field - that works.
  4. But you can also put the MAC address in the other fields (Endpoint grouping, Expiration date etc) and the MAC address still works.
  5. But if you try to filter the table using another column, with the expected values - it doesn't work.

Expected behavior I expect the filters for each column to return the relevant data from that column.

iPSK Details

  • OS: Ubuntu 24.04.3 LTS
  • iPSK Manager Version: Latest
  • MySQL Version: 8.0.43-0ubuntu0.24.04.2

**Screenshots **

Screenshot with no filters entered: Image

Searching for a MAC address in the MAC address filter:

Image

Searching for a MAC address in the endpoint group column

Image

Searching with a MAC address in the Expiration Date column.

Image

Searching for a specific Endpoint Group called "AV-Routable-Test" by searching for "AV" and nothing appears:

Image

brdlyp avatar Oct 27 '25 05:10 brdlyp

I'll look into this and try and reproduce myself. I thought I had found and corrected a filter issue that cropped up after another change but maybe it came back with a library bump and missed the issue coming up again.

ciesinsn avatar Nov 04 '25 21:11 ciesinsn

I'll look into this and try and reproduce myself. I thought I had found and corrected a filter issue that cropped up after another change but maybe it came back with a library bump and missed the issue coming up again.

Hi @ciesinsn, Thank you for having a look into it.

Just letting you know as well, this filter issue is also present on the Sponsor Portal Endpoint management page as well.

brdlyp avatar Nov 04 '25 22:11 brdlyp

Hi @ciesinsn - I have exactly the same issue, what we noticed is that the first field always works fine. If you disable "MAC Address" column visibility then "iPSK Endpoint Grouping" works fine. What is more - the main search box (above the column one) seems to work fine.

pio-gra avatar Nov 06 '25 12:11 pio-gra

Image

pio-gra avatar Nov 06 '25 12:11 pio-gra

Line 220 in supportfiles/adminportals/modules/endpoints/endpoints.inc.php needs to have one of the parents() removed.

karrots avatar Nov 07 '25 02:11 karrots

Interesting if it is the second parent() causing it as that was added in commit b860ff0 last year to fix a filter issue. My guess would be then the bump of datatables in the last commit is what broke it as something was changed within the library.

ciesinsn avatar Nov 07 '25 03:11 ciesinsn

If it changed the structure of the DOM possibly. I'm not on a version new enough to validate or have this issue. I just asked Github Copilot about the issue. This was its response.

Root Cause: The DataTables column filter event handler was using the wrong jQuery selector to determine which column to search. It was using $(this).parent().parent().index() (the row's index) instead of $(this).parent().index() (the TH cell's index), causing all filter inputs to search column 0 (MAC Address) regardless of which field the user typed into.

karrots avatar Nov 07 '25 03:11 karrots

Updated and tested on my install. It doesn't seem to fix it but I need to validate the change is happening in the browser.

karrots avatar Nov 10 '25 05:11 karrots

Hey,

Full disclosure, not a real programmer lol. But Cursor vibe coded this fix, which I synced to a fork I made of this project. https://github.com/brdlyp/iPSK-Manager/commit/ce60e3311ca1c0a7f741bfd7f6220b01d0268cd9

Just for your information.

brdlyp avatar Nov 10 '25 05:11 brdlyp

This is fixed in branch dec25 and will be merged in next pull request.

ciesinsn avatar Dec 23 '25 23:12 ciesinsn