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

Downloading a label makes the app crash #64

Closed
rickyheijnen opened this issue May 26, 2021 · 3 comments · Fixed by #65
Closed

Downloading a label makes the app crash #64

rickyheijnen opened this issue May 26, 2021 · 3 comments · Fixed by #65

Comments

@rickyheijnen
Copy link
Contributor

rickyheijnen commented May 26, 2021

This line generates a fatal error:
$dhlparcel->labels->get($label_id);

Fatal error: in /var/www/html/vendor/mvdnbrk/dhlparcel-php-api/src/Endpoints/BaseEndpoint.php on line 68

Expected behavior
The shipment label should be returned in PDF

Please complete the following information:

  • Version of this package: 1.4.0
  • PHP Version: 7.3.27
@rickyheijnen
Copy link
Contributor Author

I see the unit test is also failing, I will create a fix for this

@bastiaansenglenn
Copy link
Contributor

@rickyheijnen I encountered the same problem and solved it like this;

$this->client = new \Mvdnbrk\DhlParcel\Client();
$token           = $this->client->authentication->getAccessToken();
$labelResult  = $this->client->performHttpCall(
                'GET',
                'labels/' . $labelId,
                null,
                [
                    'Accept' => 'application/pdf',
                    'Authorization' => 'Bearer ' . $token->token
                ]
            );

@rickyheijnen
Copy link
Contributor Author

Thank you! That is a solid solution and I used kind of the same solution to have a quick workaround. But its better solve this in this PHP API so a solution is available for everybody without having to change their own code.

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

Successfully merging a pull request may close this issue.

2 participants