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

Cannot POST categories #2

Open
paddelboot opened this issue Jun 18, 2020 · 1 comment
Open

Cannot POST categories #2

paddelboot opened this issue Jun 18, 2020 · 1 comment

Comments

@paddelboot
Copy link

Hi,

I have been using this client for several use cases without any problems. But recently, I cannot seem to POST any categories anymore.

Here's my code:

    $response = $this->Client->post( Categories::class, [
            'name' => $Resource[ 'cat_name' ],
            'description' => $Resource[ 'cat_desc' ],
            'attribute' => ['remoteid' => $Resource[ 'cat_id' ]]
        ]
    );

    $responseArray = $response->toArray();

Which leads to this error:

PHP Fatal error: Uncaught TypeError: Return value of Shopbase\\ShopwareClient\\Response::toArray() must be of the type array, null returned in /media/[...]/vendor/shopbase/shopware-client/src/Response.php

Am I missing something? I checked the $response object, the data property is empty.

Thanks.

@paddelboot
Copy link
Author

paddelboot commented Jun 23, 2020

The main problem seems to be:

PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /www/htdocs/xyz/shopware/engine/Shopware/Components/Model/CategorySubscriber.php:296

Any clues?

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

1 participant