Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutation [Object & Asset] - Enabling of versionNote declaration #841

Open
wants to merge 4 commits into
base: 1.x
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion src/GraphQL/Mutation/MutationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@
'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()],
Expand Down Expand Up @@ -722,6 +723,7 @@
'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()],
Expand Down Expand Up @@ -938,6 +940,7 @@
'fields' => [
'success' => ['type' => Type::boolean()],
'message' => ['type' => Type::string()],
'versionNote' => ['type' => Type::string()],
'assetData' => [
'args' => ['defaultLanguage' => ['type' => Type::string()]],
'type' => $assetType,
Expand Down Expand Up @@ -1075,6 +1078,7 @@
'fields' => [
'success' => ['type' => Type::boolean()],
'message' => ['type' => Type::string()],
'versionNote' => ['type' => Type::string()],
'assetData' => [
'args' => ['defaultLanguage' => ['type' => Type::string()]],
'type' => $assetType,
Expand Down Expand Up @@ -1572,12 +1576,12 @@
}

$omitVersionCreateBefore = Version::$disabled;

Check failure on line 1579 in src/GraphQL/Mutation/MutationType.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0, lowest, false)

Method Pimcore\Model\Element\ElementInterface::save() invoked with 1 parameter, 0 required.
if (isset($options['omitVersionCreate']) && $options['omitVersionCreate']) {
Version::disable();
}

$element->save();
$element->save(['versionNote' => isset($options['versionNote']) ? $options['versionNote'] : null]);

Check failure on line 1584 in src/GraphQL/Mutation/MutationType.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.0, lowest, false)

Method Pimcore\Model\Element\ElementInterface::save() invoked with 1 parameter, 0 required.

if (isset($options['omitVersionCreate']) && $options['omitVersionCreate'] && !$omitVersionCreateBefore) {
Version::enable();
Expand Down
Loading