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

Unable to Delete Entry if It's in applenews_article Table #20

Open
zhua89cc opened this issue May 17, 2023 · 0 comments
Open

Unable to Delete Entry if It's in applenews_article Table #20

zhua89cc opened this issue May 17, 2023 · 0 comments
Labels

Comments

@zhua89cc
Copy link

Description

Similar issue to this bug #11 however my error is a return type error (see screenshot)
The deleteArticle method is expecting a return type of stdClass but I actually get an empty string. Following the chain of methods

` public function deleteArticle(string $channelId, string $articleId): stdClass
{
return $this->delete($channelId, '/articles/{article_id}', [
'article_id' => $articleId,
]);
}

calls

/**
 * Sends a DELETE request to the Apple News API.
 *
 * @param string $channelId
 * @param string $path
 * @param array $pathArgs
 * @param array $data
 * @return mixed
 */
protected function delete(string $channelId, string $path, array $pathArgs = [], array $data = [])
{
    return $this->api($channelId)->delete($path, $pathArgs, $data);
}

which instantiates publisherAPI which then calls

/**

  • Create DELETE request to a specified endpoint.
  • @param (string) $path API endpoint path.
  • @param (string) $path_args Endpoint path arguments to replace tokens in the path.
  • @param (string) $data Raw content of the request or associative array to pass to endpoints.
  • @return object Preprocessed structured object and returns 204 No Content on success, with no response body.
    */
    public function delete($path, Array $path_args = [], Array $data = []) {
    parent::delete($path, $path_args, $data);
    $this->setHeaders(
    [
    'Authorization' => $this->auth()
    ]
    );
    $this->unsetHeaders(
    [
    'Content-Type'
    ]
    );
    return $this->request($data);
    }`

We haven't changed anything on our end so this is a little strange. Unless the news api has changed their responses.

Steps to reproduce

Additional info

  • Craft version: 3.7.63.1
  • PHP version: 8
  • Database driver & version:
  • Plugins & versions: 2.0.1
@zhua89cc zhua89cc added the bug label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant