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

[Bug][Data loss]: if passing an invalid asset.id, fullpath to object mutation GraphQL query, the assets are silently discarded #825

Merged
Changes from 2 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
5 changes: 5 additions & 0 deletions src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ElementIdentificationTrait;
use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData;
use Pimcore\Model\Exception\NotFoundException;

class ManyToManyRelation extends Base
{
Expand All @@ -45,6 +46,10 @@ public function process($object, $newValue, $args, $context, ResolveInfo $info)

if ($element) {
$result[] = $element;
} else {
throw new NotFoundException(
"Doesn't found element: " . $newValueItemValue['fullpath']
kingjia90 marked this conversation as resolved.
Show resolved Hide resolved
);
}
}
}
Expand Down
Loading