diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fdd3172..d6025b0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [UNRELEASED] + +### Fixed + +- Fix - Ensure selected states is always an array in inventory selector + ## [1.9.6] - 2026-05-22 ### Fixed diff --git a/inc/inventory.class.php b/inc/inventory.class.php index 63efcbb4..de30da4d 100644 --- a/inc/inventory.class.php +++ b/inc/inventory.class.php @@ -45,6 +45,9 @@ public static function selectorForMultipleStates($field, $condition = [], $label $selected_states = []; if (isset($_SESSION['mreporting_values'][$field])) { $selected_states = $_SESSION['mreporting_values'][$field]; + if (!is_array($selected_states)) { + $selected_states = []; + } } else { $selected_states = self::getDefaultState(); }