From d2ff0bb3473992719e3a75bd5b4760ee0a30d9ac Mon Sep 17 00:00:00 2001 From: Jana Peper Date: Wed, 11 Dec 2024 18:18:54 +0100 Subject: [PATCH] feat: add occ command for task type toggling Signed-off-by: Jana Peper --- core/Command/TaskProcessing/EnabledCommand.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/Command/TaskProcessing/EnabledCommand.php b/core/Command/TaskProcessing/EnabledCommand.php index 5c5adbfb8531f..6a076bc4eab68 100644 --- a/core/Command/TaskProcessing/EnabledCommand.php +++ b/core/Command/TaskProcessing/EnabledCommand.php @@ -22,7 +22,7 @@ public function __construct( protected function configure() { $this - ->setName('taskprocessing:task:set-enabled') + ->setName('taskprocessing:task-type:set-enabled') ->setDescription('Enable or disable a task type') ->addArgument( 'task-type-id', @@ -44,11 +44,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($json === '') { $taskTypeSettings = []; } else { - $taskTypeSettings = json_decode($json, true); + $taskTypeSettings = json_decode($json, true, flags: JSON_THROW_ON_ERROR); } $taskTypeSettings[$taskType] = $enabled; + $taskTypeSettings[$taskType] = $enabled; + $this->config->setAppValue('core', 'ai.taskprocessing_type_preferences', json_encode($taskTypeSettings)); $this->writeArrayInOutputFormat($input, $output, $taskTypeSettings);