Skip to content

Commit 274b290

Browse files
committed
Fixed #4303
1 parent ea5cde6 commit 274b290

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Fixed a bug where fulfilling an order with purchasables in different inventory locations would only fulfil items from one location. ([#4299](https://github.com/craftcms/commerce/issues/4299))
66
- Fixed a PHP error that could occur when applying project config changes after updating.
7+
- PDF download URLs now use the `code` query param instead of `token`. Existing URLs with `token` can be redirected via a server rewrite rule (see [upgrade notes](https://gist.github.com/lukeholder/7605ee8dbb0cbde305ba86bc05747315) [#4303](https://github.com/craftcms/commerce/issues/4303)).
78

89
## 5.6.5 - 2026-05-14
910

src/controllers/DownloadsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function actionPdf(): Response
8282
$pdfHandle = $this->request->getQueryParam('pdfHandle');
8383
$option = $this->request->getQueryParam('option', '');
8484
$inline = (bool) $this->request->getQueryParam('inline', false);
85-
$token = $this->request->getQueryParam('token');
85+
$token = $this->request->getQueryParam('code');
8686

8787
if (!$number) {
8888
throw new BadRequestHttpException('Order number required');

src/services/Pdfs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public function getPdfUrl(Order $order, string $option = null, string $pdfHandle
493493
// Build the URL parameters
494494
$params = [
495495
'number' => $order->number,
496-
'token' => $token,
496+
'code' => $token,
497497
];
498498

499499
if ($pdfHandle !== null) {

0 commit comments

Comments
 (0)