Skip to content

Commit

Permalink
Merge branch 'release/4.2.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Feb 2, 2023
2 parents 0485c51 + 68fb3fc commit 652e6ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Craft Commerce

## 4.2.5.1 - 2023-02-02

- Fixed a PHP error that occurred when retrieving orders with missing line item descriptions or SKUs. ([#2936](https://github.com/craftcms/commerce/issues/2936))

## 4.2.5 - 2023-02-01

- Added support for searching for orders by customer name. ([#3050](https://github.com/craftcms/commerce/issues/3050))
Expand Down
17 changes: 12 additions & 5 deletions src/models/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,17 @@ public function getDescription(): string
}

/**
* @param string $description
* @param ?string $description
* @return void
*/
public function setDescription(string $description): void
public function setDescription(?string $description): void
{
$this->_description = $description;
$this->_description = (string)$description;
}

/**
* @return string
*/
public function getSku(): string
{
if (!$this->_sku) {
Expand All @@ -334,9 +337,13 @@ public function getSku(): string
return $this->_sku;
}

public function setSku(string $sku): void
/**
* @param ?string $sku
* @return void
*/
public function setSku(?string $sku): void
{
$this->_sku = $sku;
$this->_sku = (string)$sku;
}

/**
Expand Down

0 comments on commit 652e6ce

Please sign in to comment.