Skip to content

Commit

Permalink
Fix config:set command for inventory context
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne authored and trasher committed Jun 2, 2022
1 parent 52a5ade commit 9c1ba80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Console/Config/SetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$key = Toolbox::addslashes_deep($input->getArgument('key'));
$value = Toolbox::addslashes_deep($input->getArgument('value'));

if (!preg_match('/^core|plugin:[a-z]+$/', $context)) {
if (!preg_match('/^core|inventory|plugin:[a-z]+$/', $context)) {
$output->writeln(
sprintf(
'<error>' . __('Invalid context "%s".') . '</error>',
Expand Down
4 changes: 2 additions & 2 deletions src/Inventory/Conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public function showConfigForm()
{
global $CFG_GLPI;

$config = \Config::getConfigurationValues('Inventory');
$config = \Config::getConfigurationValues('inventory');
$canedit = \Config::canUpdate();

if ($canedit) {
Expand Down Expand Up @@ -743,7 +743,7 @@ public function saveConf(array $values)
public function __get($name)
{
if (!count($this->currents)) {
$config = \Config::getConfigurationValues('Inventory');
$config = \Config::getConfigurationValues('inventory');
$this->currents = $config;
}
if (in_array($name, array_keys(self::$defaults))) {
Expand Down

0 comments on commit 9c1ba80

Please sign in to comment.