Filters for the Managed iPSK EndPoints Page are not Filtering Correctly
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:
- Select Managed iPSK Endpoints
- Grab a MAC address for an endpoint that already exists in your iPSK Manager.
- Search with that MAC address in the Filter MAC Address field - that works.
- But you can also put the MAC address in the other fields (Endpoint grouping, Expiration date etc) and the MAC address still works.
- 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:
Searching for a MAC address in the MAC address filter:
Searching for a MAC address in the endpoint group column
Searching with a MAC address in the Expiration Date column.
Searching for a specific Endpoint Group called "AV-Routable-Test" by searching for "AV" and nothing appears:
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.
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.
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.
Line 220 in supportfiles/adminportals/modules/endpoints/endpoints.inc.php needs to have one of the parents() removed.
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.
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.
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.
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.
This is fixed in branch dec25 and will be merged in next pull request.