diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b5cc2c..c6f18fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,11 @@ 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] +## [UNRELEASED] ### Fixed +- Decode dynamic group search filter as an array instead of an object - Fix missing validation checks in database inventory tasks and actions ## [1.1.3] - 2026-05-05 diff --git a/inc/computergroup.class.php b/inc/computergroup.class.php index cadb3f6..f655a0d 100644 --- a/inc/computergroup.class.php +++ b/inc/computergroup.class.php @@ -273,6 +273,8 @@ public static function uninstall(Migration $migration) if ($DB->tableExists($table)) { $DB->doQuery('DROP TABLE IF EXISTS `' . self::getTable() . '`'); } + + (new DisplayPreference())->deleteByCriteria(['itemtype' => self::class]); } public static function getIcon() diff --git a/inc/computergroupdynamic.class.php b/inc/computergroupdynamic.class.php index 65eeafa..88b08b3 100644 --- a/inc/computergroupdynamic.class.php +++ b/inc/computergroupdynamic.class.php @@ -183,7 +183,7 @@ private function countDynamicItems() public function isDynamicSearchMatchComputer(Computer $computer) { // add new criteria to force computer ID - $search = json_decode((string) $this->fields['search']); + $search = json_decode((string) $this->fields['search'], true, 512, JSON_THROW_ON_ERROR); $search['criteria'][] = [ 'link' => 'AND', diff --git a/inc/credential.class.php b/inc/credential.class.php index b1c4dc8..c6c852e 100644 --- a/inc/credential.class.php +++ b/inc/credential.class.php @@ -246,6 +246,8 @@ public static function uninstall(Migration $migration) if ($DB->tableExists($table)) { $DB->doQuery('DROP TABLE IF EXISTS `' . self::getTable() . '`'); } + + (new DisplayPreference())->deleteByCriteria(['itemtype' => self::class]); } public static function getIcon() diff --git a/inc/databaseparam.class.php b/inc/databaseparam.class.php index 4b4ecb2..5da76f2 100644 --- a/inc/databaseparam.class.php +++ b/inc/databaseparam.class.php @@ -277,6 +277,8 @@ public static function uninstall(Migration $migration) if ($DB->tableExists($table)) { $DB->doQuery('DROP TABLE IF EXISTS `' . self::getTable() . '`'); } + + (new DisplayPreference())->deleteByCriteria(['itemtype' => self::class]); } public static function getIcon() diff --git a/rector.php b/rector.php index 87d418a..33fd121 100644 --- a/rector.php +++ b/rector.php @@ -28,30 +28,27 @@ * ------------------------------------------------------------------------- */ +use Rector\Configuration\RectorConfigBuilder; + require_once __DIR__ . '/../../src/Plugin.php'; -use Rector\Caching\ValueObject\Storage\FileCacheStorage; -use Rector\Config\RectorConfig; -use Rector\ValueObject\PhpVersion; +$baseline_file = __DIR__ . '/../../PluginsRector.php'; +if (!file_exists($baseline_file)) { + throw new RuntimeException( + sprintf( + 'Unable to find "%s". Running rector on a plugin requires a GLPI development checkout that ships PluginsRector.php.', + $baseline_file, + ), + ); +} + +$baseline = require $baseline_file; + +/** @var RectorConfigBuilder $config */ +$config = $baseline([ + __DIR__ . '/ajax', + __DIR__ . '/front', + __DIR__ . '/inc', +]); -return RectorConfig::configure() - ->withPaths([ - __DIR__ . '/ajax', - __DIR__ . '/front', - __DIR__ . '/inc', - ]) - ->withPhpVersion(PhpVersion::PHP_82) - ->withCache( - cacheDirectory: __DIR__ . '/var/rector', - cacheClass: FileCacheStorage::class, - ) - ->withRootFiles() - ->withParallel(timeoutSeconds: 300) - ->withImportNames(removeUnusedImports: true) - ->withPreparedSets( - deadCode: true, - codeQuality: true, - codingStyle: true, - ) - ->withPhpSets(php82: true) // apply PHP sets up to PHP 8.2 -; +return $config;