Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions inc/computergroup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion inc/computergroupdynamic.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions inc/credential.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions inc/databaseparam.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
45 changes: 21 additions & 24 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;