Skip to content

Kanban tag: filter throws JS error and does not filter (SearchInput.makeTagEditable — Cannot read properties of undefined reading 'raw') #371

Description

@makark386

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

GLPI Version

11.0.8

Plugin version

2.14.6

Bug description

On the Project Kanban, filtering by the tag: search term (added by the Tag plugin via Hooks::KANBAN_FILTERS) does not work. Other built-in filters (e.g. user:, team:) work correctly on the same board.

When interacting with an already-entered tag: filter term in the search box (e.g. clicking on it to edit), the browser console shows:

Uncaught TypeError: Cannot read properties of undefined (reading 'raw')
at SearchInput.makeTagEditable (SearchInput.js:497:1)
at HTMLSpanElement. (SearchInput.js:358:1)
at HTMLDivElement.dispatch (base.min.js:156:41760)
at HTMLDivElement. (base.min.js:156:39643)

This appears to happen because SearchInput.makeTagEditable expects a matching suggestion object (with a .raw property) from a predefined list of values for the tag, but the tag filter registered by the Tag plugin is a free-text filter with no predefined values list — so the lookup returns undefined and the subsequent .raw access throws. After this error, the Kanban's filtering JS appears to break entirely and the filter is never applied to the displayed cards.

This looks related to a previously reported GLPI core issue (glpi-project/glpi#13593), where the same SearchInput.js code path failed for the type: filter on 10.0.5 for a similar reason (missing suggestion data). It seems to now affect the Tag plugin's tag:/tagged: filters on GLPI 11.0.8.

Relevant log output

Page URL

No response

Steps To reproduce

  1. Install/enable Tag plugin 2.14.6 on GLPI 11.0.8.
  2. Tag at least one Project.
  3. Open the global Project Kanban.
  4. Type tag: into the search box and press Enter.
  5. Click on the resulting filter term in the search box to edit it (or simply observe that no filtering is applied to the cards).
  6. Check browser console — the TypeError above appears.

Expected behavior:
The tag: filter should actually filter the visible Project cards by tag, and clicking to edit an existing filter term should not throw a JS error.

Actual behavior:
No filtering occurs on the cards, and a JS TypeError is thrown in the console, which appears to break further Kanban filter interactions.

Your GLPI setup information

No response

Anything else?

  • Other Kanban filters (user:, team:) work fine on the same board.
  • Plugin's setup.php registers the filters as:

$common_kanban_filters = [
'tag' => [
'description' => _x('filters', 'If the item has a tag', 'tag'),
'supported_prefixes' => ['!'],
],
'tagged' => [
'description' => _x('filters', 'If the item is tagged', 'tag'),
'supported_prefixes' => ['!'],
],
];

No values (suggestion list) is provided for the tag filter, which may be what triggers the core JS bug when the term is rendered/edited.

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