Skip to content

Commit

Permalink
Merge pull request #107 from craftcms/feature/pt-1835-a-license-witho…
Browse files Browse the repository at this point in the history
…ut-a-linked-order-results-in-an-error

Fixed #100 PHP error when eager loading orders on license query
  • Loading branch information
nfourtythree authored Feb 3, 2025
2 parents 3f3e256 + e8fe030 commit 506486c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed a bug where users with “Manage licenses” permission weren’t allowed to edit licenses. ([#105](https://github.com/craftcms/digital-products/issues/105))
- Fixed a PHP error that could occur when eager loading orders on a license query. ([#100](https://github.com/craftcms/digital-products/issues/100))

## 3.2.3 - 2023-09-11

Expand Down
1 change: 1 addition & 0 deletions src/elements/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ public static function eagerLoadingMap(array $sourceElements, string $handle): a
->select('id as source, orderId as target')
->from('{{%digitalproducts_licenses}}')
->where(['in', 'id', $sourceElementIds])
->andWhere(['not', ['orderId' => null]])
->all();

return [
Expand Down

0 comments on commit 506486c

Please sign in to comment.