Skip to content

Dynamic User Filtering Fails After First Character (JavaScript Error) #646

@alkopi

Description

@alkopi

Summary

In LDAP Account Manager (LAM) version 9.2, the dynamic user filtering mechanism used when assigning users to groups fails after the first typed character. Subsequent characters trigger a JavaScript error originating from the filterDynamic function, causing the filtering to stop working entirely.

Affected Component

  • Dynamic user search in group membership editing
  • CSS class: lam_dynamicOptions
  • JavaScript function: filterDynamic

Environment

  • LAM Version: 9.2 (No known related issues or fixes found in later releases)
  • Browser: Firefox 140.8.0esr (64‑bit)

Steps to Reproduce

  1. Start with page showing the groups, which is in my local test installation: http://localhost/lam/templates/lists/list.php?type=group
  2. Edit a group
  3. Open the Modify Members section.
  4. In the list of available users, start typing into the filter field. Ensure that the number of available users exceeds the limit defined in enableDynamicScrolling() in /usr/share/ldap-account-manager/lib/html.inc (starting at line 1616).
  5. Observe the behavior:
    5.1. After the first character, filtering works correctly.
    5.2. After the second or third character, a JavaScript error occurs and filtering stops.

Expected Behavior

The dynamic filtering should update the list of available users with every keystroke, without errors, regardless of how many characters are typed.

Technical Observations

  • The issue appears related to index handling within the filterDynamic function.
  • It seems that the function continues to use the original list indices even after the list has been reduced by previous filtering steps.
  • This leads to out‑of‑range index access, causing the JavaScript error.
  • The error typically occurs on the second or third character typed.

Impact

  • Group membership management becomes cumbersome or impossible when many users exist.
  • Administrators must fall back to non‑dynamic search or manual scrolling.

Screenshot

  • There is a screenshot attached showing the case of a reduced list with 222 elements and an index of 331.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions