Skip to content

Fix - Ensure selected states is always an array in inventory selector#363

Open
RomainLvr wants to merge 2 commits into
mainfrom
fix/mreporting-state-selector-count-error
Open

Fix - Ensure selected states is always an array in inventory selector#363
RomainLvr wants to merge 2 commits into
mainfrom
fix/mreporting-state-selector-count-error

Conversation

@RomainLvr
Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes !44484
  • Here is a brief description of what this PR does

When a user submits a search with an empty state field in mreporting reports (e.g. "Computers by OS"), the session stores an empty string instead of an array for the states selector. This causes a fatal error when count() is called on it, requiring a session cache flush to recover.

Added an is_array() guard after reading the session value so it always falls back to an empty array, preventing the crash.

@RomainLvr RomainLvr requested review from Rom1-B and stonebuzz June 5, 2026 09:48
@RomainLvr RomainLvr self-assigned this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants