From 9f56268a352fa30c741179ef13ef602fe965108a Mon Sep 17 00:00:00 2001 From: Christoph Leitgeb <98694299+leitge@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:58:45 +0100 Subject: [PATCH 1/4] Update MutationType.php --- src/GraphQL/Mutation/MutationType.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/GraphQL/Mutation/MutationType.php b/src/GraphQL/Mutation/MutationType.php index bd919d0ab..0c4febce2 100644 --- a/src/GraphQL/Mutation/MutationType.php +++ b/src/GraphQL/Mutation/MutationType.php @@ -583,6 +583,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) 'parentId' => ['type' => Type::int()], 'defaultLanguage' => ['type' => Type::string()], 'published' => ['type' => Type::boolean(), 'description' => 'Default is true!'], + 'versionNote' => ['type' => Type::string()], 'omitMandatoryCheck' => ['type' => Type::boolean()], 'userId' => ['type' => Type::int()], 'type' => ['type' => Type::string()], @@ -722,6 +723,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) 'fullpath' => ['type' => Type::string()], 'parentId' => ['type' => Type::int()], 'defaultLanguage' => ['type' => Type::string()], + 'versionNote' => ['type' => Type::string()], 'omitMandatoryCheck' => ['type' => Type::boolean()], 'omitVersionCreate' => ['type' => Type::boolean()], 'userId' => ['type' => Type::int()], @@ -938,6 +940,7 @@ public function buildCreateAssetMutation(&$config, $context) 'fields' => [ 'success' => ['type' => Type::boolean()], 'message' => ['type' => Type::string()], + 'versionNote' => ['type' => Type::string()], 'assetData' => [ 'args' => ['defaultLanguage' => ['type' => Type::string()]], 'type' => $assetType, @@ -1075,6 +1078,7 @@ public function buildUpdateAssetMutation(&$config, $context) 'fields' => [ 'success' => ['type' => Type::boolean()], 'message' => ['type' => Type::string()], + 'versionNote' => ['type' => Type::string()], 'assetData' => [ 'args' => ['defaultLanguage' => ['type' => Type::string()]], 'type' => $assetType, @@ -1577,7 +1581,7 @@ protected function saveElement($element, $options): void Version::disable(); } - $element->save(); + $element->save(["versionNote" => isset($args['versionNote']) ? $args['versionNote'] : null]); if (isset($options['omitVersionCreate']) && $options['omitVersionCreate'] && !$omitVersionCreateBefore) { Version::enable(); From 88123f21a634cf48b7382b8206576591c4468c8d Mon Sep 17 00:00:00 2001 From: leitge Date: Thu, 29 Feb 2024 14:59:02 +0000 Subject: [PATCH 2/4] Apply php-cs-fixer changes --- src/GraphQL/Mutation/MutationType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GraphQL/Mutation/MutationType.php b/src/GraphQL/Mutation/MutationType.php index 0c4febce2..bdb96e4f0 100644 --- a/src/GraphQL/Mutation/MutationType.php +++ b/src/GraphQL/Mutation/MutationType.php @@ -1581,7 +1581,7 @@ protected function saveElement($element, $options): void Version::disable(); } - $element->save(["versionNote" => isset($args['versionNote']) ? $args['versionNote'] : null]); + $element->save(['versionNote' => isset($args['versionNote']) ? $args['versionNote'] : null]); if (isset($options['omitVersionCreate']) && $options['omitVersionCreate'] && !$omitVersionCreateBefore) { Version::enable(); From d7012e4d72ab7f6833b7050236bcf428132dcf64 Mon Sep 17 00:00:00 2001 From: Christoph Leitgeb <98694299+leitge@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:03:51 +0100 Subject: [PATCH 3/4] Update MutationType.php --- src/GraphQL/Mutation/MutationType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GraphQL/Mutation/MutationType.php b/src/GraphQL/Mutation/MutationType.php index bdb96e4f0..ca9b34335 100644 --- a/src/GraphQL/Mutation/MutationType.php +++ b/src/GraphQL/Mutation/MutationType.php @@ -1581,7 +1581,7 @@ protected function saveElement($element, $options): void Version::disable(); } - $element->save(['versionNote' => isset($args['versionNote']) ? $args['versionNote'] : null]); + $element->save(["versionNote" => isset($options['versionNote']) ? $options['versionNote'] : null]); if (isset($options['omitVersionCreate']) && $options['omitVersionCreate'] && !$omitVersionCreateBefore) { Version::enable(); From 4c2344cab233613383bcca626aecdd4486eea594 Mon Sep 17 00:00:00 2001 From: leitge Date: Thu, 29 Feb 2024 15:04:09 +0000 Subject: [PATCH 4/4] Apply php-cs-fixer changes --- src/GraphQL/Mutation/MutationType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GraphQL/Mutation/MutationType.php b/src/GraphQL/Mutation/MutationType.php index ca9b34335..4bf98e49f 100644 --- a/src/GraphQL/Mutation/MutationType.php +++ b/src/GraphQL/Mutation/MutationType.php @@ -1581,7 +1581,7 @@ protected function saveElement($element, $options): void Version::disable(); } - $element->save(["versionNote" => isset($options['versionNote']) ? $options['versionNote'] : null]); + $element->save(['versionNote' => isset($options['versionNote']) ? $options['versionNote'] : null]); if (isset($options['omitVersionCreate']) && $options['omitVersionCreate'] && !$omitVersionCreateBefore) { Version::enable();