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

Images are wrongly assigned to a random payment service after upload with MediaService #90

Closed
JeremiahHarm opened this issue Jul 30, 2024 · 1 comment

Comments

@JeremiahHarm
Copy link

After I upload a new media (image) for a product with the method uploadMediaFromUrl with a newly generated media ID, filename, extension and URL this media is connected to a payment service. I did not start to sync a payload with ProductMedia, that step would come next, but (after a few tests) does not have anything to do with this problem.

So I just upload an image through the API and it gets connected to a payment service in Shopware 6.

It's a random payment service though, every time another one...

Code:

    $context      = new Context($config['shop_url'], $this->accessToken);
    $mediaService = new MediaService();
    $mediaService->setContext($context);
    $mediaRepo    = RepositoryFactory::create(MediaDefinition::ENTITY_NAME);
    $mediaId      = $mediaRepo->searchIds(new Criteria(), $context)->firstId();
    $mediaService->uploadMediaFromUrl($mediaId, $url, $ext, $filename);

    // This works afterwards , but doesn't have anything to do with the problem, after updating ProductMedia the media is also (ans correctly) connected to the product
    //$this->upsertProductMedia($productId, $mediaId, $mediaFolderId, $coverId, $alt, $title, $position);

Finally, thank you for this SDK, I don't just want to criticise something ;)

@vienthuong
Copy link
Owner

Sorry for the late response, I checked the script in examples/media-service.php and cannot reproduce your mentioned issue, from the script, I don't see anything could be related to a payment service so I'm not sure if the SDK's issue, feel free to reopen it if you can reproduce it with a more specific steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants